[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squirrelmail-cvs
Subject:    [SM-CVS] SF.net SVN: squirrelmail:[14440] branches/SM-1_4-STABLE/squirrelmail/ functions
From:       pdontthink () users ! sourceforge ! net
Date:       2014-01-25 2:24:59
Message-ID: E1W6svf-0008VS-DS () sfs-ml-1 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 14440
          http://sourceforge.net/p/squirrelmail/code/14440
Author:   pdontthink
Date:     2014-01-25 02:24:58 +0000 (Sat, 25 Jan 2014)
Log Message:
-----------
Better hook results testing

Modified Paths:
--------------
    branches/SM-1_4-STABLE/squirrelmail/functions/db_prefs.php
    branches/SM-1_4-STABLE/squirrelmail/functions/file_prefs.php

Modified: branches/SM-1_4-STABLE/squirrelmail/functions/db_prefs.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/functions/db_prefs.php	2014-01-23 00:37:12 \
                UTC (rev 14439)
+++ branches/SM-1_4-STABLE/squirrelmail/functions/db_prefs.php	2014-01-25 02:24:58 \
UTC (rev 14440) @@ -161,9 +161,10 @@
     function getKey($user, $key, $default = '') {
         global $prefs_cache;
 
-        $result = do_hook_function('get_pref_override', array($user, $key));
-//FIXME: testing below for !$result means that a plugin cannot fetch its own pref \
                value of 0, '0', '', FALSE, or anything else that evaluates to \
                boolean FALSE.
-        if (!$result) {
+        $result = NULL;
+        $result = do_hook_function('get_pref_override', array($user, $key, \
$default)); +// FIXME: ideally, we'd have a better way to determine if the return \
value from the hook above should be respected, even if it is NULL, but this is as \
good as it gets for now... previously the test was more weak: if (!$result) +        \
if (is_null($result)) {  cachePrefValues($user);
 
             if (isset($prefs_cache[$key])) {

Modified: branches/SM-1_4-STABLE/squirrelmail/functions/file_prefs.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/functions/file_prefs.php	2014-01-23 00:37:12 \
                UTC (rev 14439)
+++ branches/SM-1_4-STABLE/squirrelmail/functions/file_prefs.php	2014-01-25 02:24:58 \
UTC (rev 14440) @@ -89,9 +89,10 @@
 function getPref($data_dir, $username, $string, $default = '') {
     global $prefs_cache;
 
-    $result = do_hook_function('get_pref_override',array($username, $string));
-//FIXME: testing below for !$result means that a plugin cannot fetch its own pref \
                value of 0, '0', '', FALSE, or anything else that evaluates to \
                boolean FALSE.
-    if (!$result) {
+    $result = NULL;
+    $result = do_hook_function('get_pref_override',array($username, $string, \
$default, $data_dir)); +// FIXME: ideally, we'd have a better way to determine if the \
return value from the hook above should be respected, even if it is NULL, but this is \
as good as it gets for now... previously the test was more weak: if (!$result) +    \
if (is_null($result)) {  cachePrefValues($data_dir, $username);
         if (isset($prefs_cache[$string])) {
             $result = $prefs_cache[$string];

This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
-----
squirrelmail-cvs mailing list
List address: squirrelmail-cvs@lists.sourceforge.net
List info (subscribe/unsubscribe/change options): \
                https://lists.sourceforge.net/lists/listinfo/squirrelmail-cvs
Repository: http://squirrelmail.org/svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic