+/**
+ * Language was set earlier, but we can over-ride it in the session.
+ * We have to do it here because the session was just now opened.
+ */
+
+if(array_key_exists('system_language',$_POST)) {
+ if(strlen($_POST['system_language']))
+ $_SESSION['language'] = $_POST['system_language'];
+ else
+ unset($_SESSION['language']);
+}
+if((x($_SESSION,'language')) && ($_SESSION['language'] !== $lang)) {
+ $lang = $_SESSION['language'];
+ load_translation_table($lang);
+}
+
+if(x($_GET,'zrl')) {
+ $_SESSION['my_url'] = $_GET['zrl'];
+ $a->query_string = preg_replace('/[\?&]zrl=(.*?)([\?&]|$)/is','',$a->query_string);
+}
+