Changeset:
        13d639904fc0
        
https://sourceforge.net/p/mrbs/hg-code/ci/13d639904fc01a910b50d39aa6d9e319b03e41df
Author:
        Campbell Morrison <cimorri...@hg.code.sf.net>
Date:
        Sun Mar 05 15:43:01 2017 +0000
Log message:

Eliminated $locale_warning global and moved reporting of locale setting problems
to the error mechanism rather than the browser.

diffstat:

 web/Themes/default/header.inc |   7 -------
 web/language.inc              |  12 +++++-------
 2 files changed, 5 insertions(+), 14 deletions(-)

diffs (74 lines):

diff -r 631561099f00 -r 13d639904fc0 web/Themes/default/header.inc
--- a/web/Themes/default/header.inc     Sun Mar 05 15:29:04 2017 +0000
+++ b/web/Themes/default/header.inc     Sun Mar 05 15:43:01 2017 +0000
@@ -207,8 +207,6 @@
 // access or JavaScript (useful for fatal errors and database upgrades).
 function print_theme_header($day, $month, $year, $area, $room, $simple=false, 
$search_str)
 {
-  global $locale_warning;
-
   // Need to set the timezone before we can use date()
   if ($simple)
   {
@@ -265,11 +263,6 @@
     <?php
   }
   
-  if (!empty($locale_warning))
-  {
-    echo "[Warning: ".$locale_warning."]";
-  }
-  
   $class = 'banner';
   if ($simple)
   {
diff -r 631561099f00 -r 13d639904fc0 web/language.inc
--- a/web/language.inc  Sun Mar 05 15:29:04 2017 +0000
+++ b/web/language.inc  Sun Mar 05 15:43:01 2017 +0000
@@ -733,7 +733,6 @@
 ');
 }
 
-$locale_warning = '';
 $windows_locale = "eng";
 set_mrbs_locale();
 
@@ -744,7 +743,7 @@
 function get_os_locale($lang)
 {
   global $lang_map_unix, $lang_map_unix_postfix, $lang_map_windows;
-  global $locale_warning, $server_os;
+  global $server_os;
   
   $locale = FALSE;
   
@@ -756,8 +755,8 @@
     }
     else
     {
-      $locale_warning = "Server failed to map browser language '$lang' to a 
Windows locale specifier";
-      trigger_error($locale_warning, E_USER_NOTICE);
+      $message = "Server failed to map browser language '$lang' to a Windows 
locale specifier";
+      trigger_error($message, E_USER_NOTICE);
     }
   }
   /* All of these Unix OSes work in mostly the same way... */
@@ -837,8 +836,6 @@
 // browser preferences
 function set_mrbs_locale()
 {
-  global $locale_warning;
-  
   static $locale = '';
   static $have_locale = FALSE;
   static $have_valid_locale = FALSE;
@@ -860,7 +857,8 @@
     $have_valid_locale = (setlocale(LC_ALL, $locale) !== FALSE);
     if (!$have_valid_locale)
     {
-      $locale_warning = "Server failed to set locale to '$locale'";
+      $message = "Server failed to set locale to '$locale'";
+      trigger_error($message, E_USER_NOTICE);
     }
   }
 }

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Mrbs-commits mailing list
Mrbs-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to