mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/10428] Compare $data to false strictly.
Users may pass 0 or '' for $data, this should cause the user-specified $data code path to be taken. PHPBB3-10428
This commit is contained in:
parent
37fa5e56f3
commit
38c2d4da35
2 changed files with 8 additions and 8 deletions
|
@ -2345,7 +2345,7 @@ class acp_users
|
|||
{
|
||||
global $user;
|
||||
|
||||
$var = ($data) ? $data : $user_row['user_options'];
|
||||
$var = ($data !== false) ? $data : $user_row['user_options'];
|
||||
|
||||
if ($value && !($var & 1 << $user->keyoptions[$key]))
|
||||
{
|
||||
|
@ -2357,10 +2357,10 @@ class acp_users
|
|||
}
|
||||
else
|
||||
{
|
||||
return ($data) ? $var : false;
|
||||
return ($data !== false) ? $var : false;
|
||||
}
|
||||
|
||||
if (!$data)
|
||||
if ($data === false)
|
||||
{
|
||||
$user_row['user_options'] = $var;
|
||||
return true;
|
||||
|
@ -2378,7 +2378,7 @@ class acp_users
|
|||
{
|
||||
global $user;
|
||||
|
||||
$var = ($data) ? $data : $user_row['user_options'];
|
||||
$var = ($data !== false) ? $data : $user_row['user_options'];
|
||||
return ($var & 1 << $user->keyoptions[$key]) ? true : false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2343,7 +2343,7 @@ class user extends session
|
|||
{
|
||||
if (!isset($this->keyvalues[$key]))
|
||||
{
|
||||
$var = ($data) ? $data : $this->data['user_options'];
|
||||
$var = ($data !== false) ? $data : $this->data['user_options'];
|
||||
$this->keyvalues[$key] = ($var & 1 << $this->keyoptions[$key]) ? true : false;
|
||||
}
|
||||
|
||||
|
@ -2355,7 +2355,7 @@ class user extends session
|
|||
*/
|
||||
function optionset($key, $value, $data = false)
|
||||
{
|
||||
$var = ($data) ? $data : $this->data['user_options'];
|
||||
$var = ($data !== false) ? $data : $this->data['user_options'];
|
||||
|
||||
if ($value && !($var & 1 << $this->keyoptions[$key]))
|
||||
{
|
||||
|
@ -2367,10 +2367,10 @@ class user extends session
|
|||
}
|
||||
else
|
||||
{
|
||||
return ($data) ? $var : false;
|
||||
return ($data !== false) ? $var : false;
|
||||
}
|
||||
|
||||
if (!$data)
|
||||
if ($data === false)
|
||||
{
|
||||
$this->data['user_options'] = $var;
|
||||
return true;
|
||||
|
|
Loading…
Add table
Reference in a new issue