Temporary fixes for php encoding library bugs ending with segfault.
[fa-stable.git] / install / isession.inc
index acf14202d4b5f37e77c287ef48c56d60e792888e..274f1f57a3f2f217404362c463271370863b4726 100644 (file)
@@ -58,6 +58,15 @@ function html_cleanup(&$parms)
 function check_page_security($page_security)
 {
 }
+
+/*
+ Ensure file is re-read on next request if php caching is active
+*/
+function cache_invalidate($filename)
+{
+    if (function_exists('opcache_invalidate')) // OpCode extension
+        opcache_invalidate($filename);
+}
 //============================================================================
 if (!isset($path_to_root))
 {
@@ -86,6 +95,9 @@ header("Cache-control: private");
 
 include_once($path_to_root . "/config.default.php");
 
+$_SESSION['SysPrefs'] = new sys_prefs();
+$SysPrefs = &$_SESSION['SysPrefs'];
+
 $inst_langs = array(
   'C' => array ( 'name' => 'English',  'code' => 'C',          'encoding' => 'iso-8859-1'),
   'ar_EG' => array ( 'name' => 'Arabic',       'code' => 'ar_EG',      'encoding' => 'utf-8', 'rtl' => true),
@@ -119,6 +131,7 @@ if (!isset($_SESSION['language']) || !method_exists($_SESSION['language'], 'set_
        $l = array_search_value($i_lang, $inst_langs,  'code');
        $_SESSION['language'] = new language($l['name'], $l['code'], $l['encoding'],
         isset($l['rtl']) ? 'rtl' : 'ltr');
+
 }
 if (!isset($installed_languages))
        $installed_languages = array();
@@ -150,8 +163,6 @@ html_cleanup($_POST);
 html_cleanup($_REQUEST);
 html_cleanup($_SERVER);
 
-$SysPrefs = &$_SESSION['SysPrefs'];
-
 // POST vars cleanup needed for direct reuse.
 // We quote all values later with db_escape() before db update.
        $_POST = strip_quotes($_POST);