1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-14 04:30:29 +01:00

[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
This commit is contained in:
Oleg Pudeyev 2011-12-23 02:29:48 -05:00
parent 38c2d4da35
commit 16ae99eec8

View File

@ -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;
}
/**