فهرست منبع

The prefs caching in PHP 4.1 still doesn't work. While we don't
find a correct fix for this we exclude 4.1 from caching prefs.

philippe_mingo 23 سال پیش
والد
کامیت
3fabd0920e
1فایلهای تغییر یافته به همراه4 افزوده شده و 2 حذف شده
  1. 4 2
      functions/prefs.php

+ 4 - 2
functions/prefs.php

@@ -15,7 +15,8 @@ global $prefs_are_cached, $prefs_cache;
 
 if ( !session_is_registered('prefs_are_cached') ||
      !isset( $prefs_cache) ||
-     !is_array( $prefs_cache) ) {
+     !is_array( $prefs_cache) ||
+     substr( phpversion(), 0, 3 ) == '4.1'  ) {
     $prefs_are_cached = false;
     $prefs_cache = array();
 }
@@ -68,8 +69,9 @@ function cachePrefValues($data_dir, $username) {
      }
      fclose($file);
 
+    $prefs_are_cached = true;
+
      session_register('prefs_cache');
-     $prefs_are_cached = true;
      session_register('prefs_are_cached');
 }