Revision: 2974
          https://sourceforge.net/p/mrbs/code/2974/
Author:   cimorrison
Date:     2015-01-21 19:46:40 +0000 (Wed, 21 Jan 2015)
Log Message:
-----------
Fixed warning message about a missing third parameter to Locale::lookup() when 
running on PHP 5.3.0 systems with the Intl extension installed.   The 
documentation says that the third parameter is optional, so it's a probably a 
PHP bug that was fixed in later versions.

Modified Paths:
--------------
    mrbs/trunk/web/language.inc

Modified: mrbs/trunk/web/language.inc
===================================================================
--- mrbs/trunk/web/language.inc 2015-01-21 19:11:36 UTC (rev 2973)
+++ mrbs/trunk/web/language.inc 2015-01-21 19:46:40 UTC (rev 2974)
@@ -862,13 +862,18 @@
   // Charsets (eg '.UTF-8') are stripped off $locale
   //
   // Returns the best match, or else an empty string if no match
-  function locale_lookup($langtag, $locale)
+  function locale_lookup($langtag, $locale, $canonicalize = FALSE)
   {
-    if (func_num_args() > 2)
+    if (!empty($canonicalize))
     {
-      throw new Exception("MRBS: optional parameters to Locale::lookup() not 
yet supported");
+      throw new Exception('MRBS: the MRBS version of Locale::lookup() does not 
yet support $canonicalize = TRUE');
     }
     
+    if (func_num_args() > 3)
+    {
+      throw new Exception('MRBS: optional fourth parameter to Locale::lookup() 
not yet supported');
+    }
+    
     // Get the langtags and locale in the same format, ie separated by '-' and
     // all lower case
     $standard_langtags = locale_standardise($langtag);
@@ -965,7 +970,10 @@
   // Find the best fit.
   foreach ($lang_preferences as $lang => $qual)
   {
-    $locale = locale_lookup($available_langtags, $lang);
+    // For some reason the third parameter to locale_lookup() is mandatory in 
5.3.0.
+    // Can't see anything about it in the manual - must be a bug that was 
fixed in
+    // later versions.
+    $locale = locale_lookup($available_langtags, $lang, $canonicalize = FALSE);
     if (!empty($locale))
     {
       if (in_array($locale, $default_langtags))
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to