From 16ae99eec8e34ec6d542c1e4d82bd288bc0d0026 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Fri, 23 Dec 2011 02:29:48 -0500 Subject: [ticket/10428] Dispose of $this->keyvalues cache for optionget. It does not work properly when custom $data is provided, and making it work will make the code so complicated that any benefits from having this cache in the first place will be nullified. Just get rid of it. PHPBB3-10428 --- phpBB/includes/session.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'phpBB/includes/session.php') diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 50b6ac7406..d988426a87 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -1507,7 +1507,6 @@ class user extends session // Able to add new options (up to id 31) var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'popuppm' => 10, 'sig_bbcode' => 15, 'sig_smilies' => 16, 'sig_links' => 17); - var $keyvalues = array(); /** * Constructor to set the lang path @@ -2341,13 +2340,8 @@ class user extends session */ function optionget($key, $data = false) { - if (!isset($this->keyvalues[$key])) - { - $var = ($data !== false) ? $data : $this->data['user_options']; - $this->keyvalues[$key] = ($var & 1 << $this->keyoptions[$key]) ? true : false; - } - - return $this->keyvalues[$key]; + $var = ($data !== false) ? $data : $this->data['user_options']; + return ($var & 1 << $this->keyoptions[$key]) ? true : false; } /** -- cgit v1.2.1