"fixed not working delete of a preference (was set to an empty string in the db)"

This commit is contained in:
Ralf Becker 2010-05-12 09:23:50 +00:00
parent 55f5a80a5e
commit 259ae6fe24

View File

@ -520,15 +520,14 @@ class preferences
}
$pref = &$this->$type;
//if (($all = (is_string($var) && $var == ''))) // old condition replaced, as all ($all) means that var is not a string and does not have content
if (($all = empty($var))) // to check if $var is regarded as empty (false, 0, '', null, array() should do the trick
{
$pref[$app_name] = null;
unset($pref[$app_name]);
unset($this->data[$app_name]);
}
else
{
$pref[$app_name][$var] = null;
unset($pref[$app_name][$var]);
unset($this->data[$app_name][$var]);
}
// set the effectiv pref again if needed