From 9390771b3e60b802b0ace63d9265f7babe7ccb5b Mon Sep 17 00:00:00 2001 From: Matteo Gheza Date: Mon, 5 Apr 2021 23:26:40 +0200 Subject: [PATCH] Security and performance improvement --- server/core.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/core.php b/server/core.php index 0efd0dc..7207ee7 100644 --- a/server/core.php +++ b/server/core.php @@ -246,10 +246,10 @@ class database } if($this->load_from_file) { if(file_exists($this->options_cache_file)/* && time()-@filemtime($this->options_cache_file) < 604800*/) { - $this->options = unserialize(file_get_contents($this->options_cache_file), ['allowed_classes' => false]); + $this->options = json_decode(file_get_contents($this->options_cache_file), true); } else { $this->options = $this->exec("SELECT * FROM `%PREFIX%_options` WHERE `enabled` = 1", true); - file_put_contents($this->options_cache_file, serialize($this->options)); + file_put_contents($this->options_cache_file, json_encode($this->options)); } } else { $this->options = $this->exec("SELECT * FROM `%PREFIX%_options` WHERE `enabled` = 1", true);