Browse Source

When checking for prefs_are_cached we should retrieve this from the session
the proper way. Closes #995102

Thijs Kinkhorst 21 years ago
parent
commit
39f5f66142
3 changed files with 7 additions and 0 deletions
  1. 1 0
      ChangeLog
  2. 2 0
      functions/db_prefs.php
  3. 4 0
      functions/file_prefs.php

+ 1 - 0
ChangeLog

@@ -66,6 +66,7 @@ Version 1.5.1 -- CVS
   - Get alternating row colors of addressbook in sync with mailbox list.
   - Give proper error when PEAR DB not found.
   - Remove inappropriate strip_tags() from add-to-addressbook (#968475).
+  - Prefs caching didn't work properly with register_globals off (#995102).
 
 Version 1.5.0
 --------------------

+ 2 - 0
functions/db_prefs.php

@@ -56,7 +56,9 @@ global $prefs_are_cached, $prefs_cache;
 function cachePrefValues($username) {
     global $prefs_are_cached, $prefs_cache;
 
+    sqgetGlobalVar('prefs_are_cached', $prefs_are_cached, SQ_SESSION );
     if ($prefs_are_cached) {
+        sqgetGlobalVar('prefs_cache', $prefs_cache, SQ_SESSION );
         return;
     }
 

+ 4 - 0
functions/file_prefs.php

@@ -21,7 +21,9 @@ include_once(SM_PATH . 'functions/display_messages.php');
 function cachePrefValues($data_dir, $username) {
     global $prefs_are_cached, $prefs_cache;
 
+    sqgetGlobalVar('prefs_are_cached', $prefs_are_cached, SQ_SESSION );
     if ( isset($prefs_are_cached) && $prefs_are_cached) {
+    	sqgetGlobalVar('prefs_cache', $prefs_cache, SQ_SESSION );
         return;
     }
 
@@ -261,3 +263,5 @@ function getSig($data_dir, $username, $number) {
     }
     return $sig;
 }
+
+// vim: et ts=4