Corrected a few issues with languages and client-side code
authorDan
Sun, 21 Dec 2008 17:25:28 -0500
changeset 782 96848f04bbba
parent 781 93a61032d33d
child 783 368a07e59bfe
Corrected a few issues with languages and client-side code
includes/sessions.php
plugins/SpecialUserFuncs.php
--- a/includes/sessions.php	Sun Dec 21 16:56:38 2008 -0500
+++ b/includes/sessions.php	Sun Dec 21 17:25:28 2008 -0500
@@ -1007,7 +1007,7 @@
     // This is a VERY special case we are allowing. It lets the installer create languages using the Enano API.
     if ( !defined('ENANO_ALLOW_LOAD_NOLANG') )
     {
-      $language = ( isset($_GET['lang']) && preg_match('/^[a-z0-9_]+$/', @$_GET['lang']) ) ? $_GET['lang'] : intval(getConfig('default_language'));
+      $language = ( isset($_GET['lang']) && preg_match('/^[a-z0-9-_]+$/', @$_GET['lang']) ) ? $_GET['lang'] : intval(getConfig('default_language'));
       $lang = new Language($language);
       @setlocale(LC_ALL, $lang->lang_code);
     }
--- a/plugins/SpecialUserFuncs.php	Sun Dec 21 16:56:38 2008 -0500
+++ b/plugins/SpecialUserFuncs.php	Sun Dec 21 17:25:28 2008 -0500
@@ -2152,6 +2152,8 @@
     $lang_local =& $lang;
   else
     $lang_local = new Language($lang_id);
+    
+  $lang_local->get('meta_meta');
   
   $lang_strings = enano_json_encode($lang_local->strings);
   $etag = substr(sha1($lang_strings), 0, 20) . '-' . dechex($lang_local->lang_timestamp);
@@ -2179,7 +2181,7 @@
   echo "if ( typeof(enano_lang) != 'object' )
   var enano_lang = new Object();
 
-enano_lang[{$lang->lang_id}] = " . $lang_strings . ";";
+enano_lang[{$lang_local->lang_id}] = " . $lang_strings . ";";
 
   gzip_output();