$this->_jobs[] = array($domain, $path);
return;
}
-
+ // Don't fill the domains with false data
+ if (strpos($domain, $this->_lang_code) === false)
+ return;
+
$err = $this->_load_domain($domain, $path);
if ($err != 0)
{
*/
function _parse_line($line, $nbr)
{
- $line = str_replace("\\\"", "'", $line);
+ $line = str_replace("\\\"", "'", $line); // Should be inside preg_match, but I couldn't find the solution. This works.
if (preg_match('/^\s*?#/', $line)) { return; }
if (preg_match('/^\s*?msgid \"(.*?)(?!<\\\)\"/', $line, $m)) {
$this->_store_key();
}
$lang_path = $path_to_root . ($path ? '/' : '') .$path.'/lang';
- // ignore change when extension does not provide translation structure
- if (file_exists($lang_path))
+ // ignore change when extension does not provide translation structure and test for valid session.
+ if (file_exists($lang_path) && isset($_SESSION['get_text']))
$_SESSION['get_text']->add_domain($_SESSION['language']->code,
$lang_path, $path ? '' : $_SESSION['language']->version);
}
$_SESSION['OBSOLETE'] = true;
$_SESSION['EXPIRES'] = time() + 10;
- // Create new session without destroying the old one
- session_regenerate_id(false);
-
+ // Create new session destroying the old one if posiible
+ if (phpversion() >= "5.1.0")
+ session_regenerate_id(true);
+ else
+ session_regenerate_id();
+
// Grab current session ID and close both sessions to allow other scripts to use them
$newSession = session_id();
session_write_close();
-
// Set session ID to the new one, and start it back up again
+
session_id($newSession);
session_start();
-
+
// Now we unset the obsolete and expiration values for the session we want to keep
unset($_SESSION['OBSOLETE']);
unset($_SESSION['EXPIRES']);
$Session_manager = new SessionManager();
$Session_manager->sessionStart('FA'.md5(dirname(__FILE__)));
+//session_name('FA'.md5(dirname(__FILE__)));
+//session_start();
// this is to fix the "back-do-you-want-to-refresh" issue - thanx PHPFreaks
header("Cache-control: private");