Allow prefs plugins to fetch values such as FALSE, 0, '', '0', or other values that...
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 23 Jun 2008 19:54:09 +0000 (19:54 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 23 Jun 2008 19:54:09 +0000 (19:54 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13192 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/file_prefs.php

index 524ee32c4cc37d4ebdfe66d758991c59f6456728..823423cf54d735334c31210323ede1a6cadd578a 100644 (file)
@@ -111,14 +111,15 @@ function getPref($data_dir, $username, $pref_name, $default = '') {
 
     $temp = array(&$username, &$pref_name);
     $result = do_hook('get_pref_override', $temp);
-    if (!$result) {
+    if (is_null($result)) {
         cachePrefValues($data_dir, $username);
         if (isset($prefs_cache[$pref_name])) {
             $result = $prefs_cache[$pref_name];
         } else {
+//FIXME: is there a justification for having two prefs hooks so close?  who uses them?
             $temp = array(&$username, &$pref_name);
             $result = do_hook('get_pref', $temp);
-            if (!$result) {
+            if (is_null($result)) {
                 $result = $default;
             }
         }