Probably the problem with php 4.1 is a register/unregister order. This
authorphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 26 Dec 2001 13:43:48 +0000 (13:43 +0000)
committerphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 26 Dec 2001 13:43:48 +0000 (13:43 +0000)
new prefs version changes that order to a more logical one and the prefs
get cached again. Should be noted for other modules. I maintain the
workaround because it is a logical check to be done.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1960 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/prefs.php

index b4b2d9d..a25ede5 100644 (file)
@@ -29,7 +29,10 @@ function cachePrefValues($data_dir, $username) {
     if ($prefs_are_cached) {
         return;
     }
-
+    
+    session_unregister('prefs_cache');
+    session_unregister('prefs_are_cached');
+    
     /* Calculate the filename for the user's preference file */
     $filename = getHashedFile($username, $data_dir, "$username.pref");
 
@@ -65,11 +68,8 @@ function cachePrefValues($data_dir, $username) {
      }
      fclose($file);
 
-     session_unregister('prefs_cache');
      session_register('prefs_cache');
-       
      $prefs_are_cached = true;
-     session_unregister('prefs_are_cached');
      session_register('prefs_are_cached');
 }