From dddc157b45be2929c103c48f081a56655e062004 Mon Sep 17 00:00:00 2001 From: Till Brehm Date: Mon, 5 Oct 2020 14:26:41 +0200 Subject: [PATCH] Update getconf.inc.php --- server/lib/classes/getconf.inc.php | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/server/lib/classes/getconf.inc.php b/server/lib/classes/getconf.inc.php index 2c20971adb..f8bfc48c0e 100644 --- a/server/lib/classes/getconf.inc.php +++ b/server/lib/classes/getconf.inc.php @@ -30,34 +30,28 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. class getconf { - var $config; - function get_server_config($server_id, $section = '') { global $app; - if(!is_array($this->config[$server_id])) { - $app->uses('ini_parser'); - $server_id = intval($server_id); - $server = $app->db->queryOneRecord('SELECT config FROM server WHERE server_id = ?', $server_id); - $this->config[$server_id] = $app->ini_parser->parse_ini_string(stripslashes($server['config'])); - } + $app->uses('ini_parser'); + $server_id = intval($server_id); + $server = $app->db->queryOneRecord('SELECT config FROM server WHERE server_id = ?', $server_id); + $config = $app->ini_parser->parse_ini_string(stripslashes($server['config'])); if($section == '') { - return $this->config[$server_id]; + return $config; } else { - return $this->config[$server_id][$section]; + return $config[$section]; } } public function get_global_config($section = '') { global $app; - if(!@is_array($this->config['global'])) { - $app->uses('ini_parser'); - $tmp = $app->db->queryOneRecord('SELECT config FROM sys_ini WHERE sysini_id = 1'); - $this->config['global'] = $app->ini_parser->parse_ini_string(stripslashes($tmp['config'])); - } - return ($section == '') ? $this->config['global'] : $this->config['global'][$section]; + $app->uses('ini_parser'); + $tmp = $app->db->queryOneRecord('SELECT config FROM sys_ini WHERE sysini_id = 1'); + $config = $app->ini_parser->parse_ini_string(stripslashes($tmp['config'])); + return ($section == '') ? $config : $config[$section]; } public function get_security_config($section = '') { -- GitLab