diff --git a/phpBB/includes/acm/acm_db.php b/phpBB/includes/acm/acm_db.php index a9b75a9a77..0204666aa4 100644 --- a/phpBB/includes/acm/acm_db.php +++ b/phpBB/includes/acm/acm_db.php @@ -154,7 +154,7 @@ class acm } } - if ($this->exists($var_name)) + if ($this->_exists($var_name)) { if (empty($this->var_ready[$var_name])) { @@ -166,7 +166,7 @@ class acm } else { - return NULL; + return false; } } @@ -213,7 +213,7 @@ class acm } } - function exists($var_name) + function _exists($var_name) { if (!is_array($this->vars)) { diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php index 8f7e79aad5..0df3c05a98 100644 --- a/phpBB/includes/acm/acm_file.php +++ b/phpBB/includes/acm/acm_file.php @@ -114,12 +114,17 @@ class acm { global $phpEx; + if (!$this->_exists($var_name)) + { + return false; + } + include($this->cache_dir . 'data' . $var_name . ".$phpEx"); - return (isset($data)) ? $data : NULL; + return (isset($data)) ? $data : false; } else { - return ($this->exists($var_name)) ? $this->vars[$var_name] : NULL; + return ($this->_exists($var_name)) ? $this->vars[$var_name] : false; } } @@ -184,7 +189,7 @@ class acm } } - function exists($var_name) + function _exists($var_name) { if ($var_name{0} == '_') { diff --git a/phpBB/includes/acm/acm_main.php b/phpBB/includes/acm/acm_main.php index a0e6267b53..3f9e3fa60f 100644 --- a/phpBB/includes/acm/acm_main.php +++ b/phpBB/includes/acm/acm_main.php @@ -72,11 +72,7 @@ class cache extends acm return false; } - if ($this->exists('word_censors')) - { - $censors = $this->get('word_censors'); - } - else + if (!($censors = $this->get('word_censors'))) { $sql = 'SELECT word, replacement FROM ' . WORDS_TABLE; @@ -101,11 +97,7 @@ class cache extends acm */ function obtain_icons(&$icons) { - if ($this->exists('icons')) - { - $icons = $this->get('icons'); - } - else + if (!($icons = $this->get('icons'))) { global $db; @@ -136,11 +128,7 @@ class cache extends acm */ function obtain_ranks(&$ranks) { - if ($this->exists('ranks')) - { - $ranks = $this->get('ranks'); - } - else + if (!($ranks = $this->get('ranks'))) { global $db; @@ -181,11 +169,7 @@ class cache extends acm */ function obtain_attach_extensions(&$extensions, $forum_id = false) { - if ($this->exists('_extensions')) - { - $extensions = $this->get('_extensions'); - } - else + if (!($extensions = $this->get('_extensions'))) { global $db; @@ -265,11 +249,7 @@ class cache extends acm */ function obtain_bots(&$bots) { - if ($this->exists('bots')) - { - $bots = $this->get('bots'); - } - else + if (!($bots = $this->get('bots'))) { global $db; @@ -320,7 +300,12 @@ class cache extends acm foreach ($parsed_items as $key => $parsed_array) { - $parsed_array = ($this->exists('_' . $key . '_cfg')) ? $this->get('_' . $key . '_cfg') : array(); + $parsed_array = $this->get('_' . $key . '_cfg'); + + if (!$parsed_array) + { + $parsed_array = array(); + } $reparse = false; $filename = $phpbb_root_path . 'styles/' . $theme[$key . '_path'] . '/' . $key . '/' . $key . '.cfg'; diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 5c6eceba2a..6f76c0144e 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -666,11 +666,7 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_ if (!isset($attachment_tpl)) { - if ($cache->exists('attachment_tpl')) - { - $attachment_tpl = $cache->get('attachment_tpl'); - } - else + if (!($attachment_tpl = $cache->get('attachment_tpl'))) { $attachment_tpl = array();