[Mapbender-dev] use of deprecated function "split" in file "http/classes/class_locale.php"

Marc Jansen jansen at terrestris.de
Thu Apr 29 10:49:37 EDT 2010


Hi devs,

in file "http/classes/class_locale.php" we use "split", which is 
deprecated as of PHP 5.3 [1]. The patch below replaces "split" with 
"explode", which should be what is meant there (we didn't split by a 
complicated regular expression but a simple string). If we decide on 
leaving "split" in there, some CMS embedding Mapbender will display ugly 
warnings (Typo3 in my particular case). The ticket for this is [2].

I was afraid of directly commiting this, so decide whether you want that 
change in trunk or not. BTW whats the policy for commits? I think I 
still have rights to commit.

Regards,
Marc

[1] http://php.net/manual/en/function.split.php
[2] http://trac.osgeo.org/mapbender/ticket/635



Index: http/classes/class_locale.php
===================================================================
--- http/classes/class_locale.php    (revision 6042)
+++ http/classes/class_locale.php    (working copy)
@@ -257,7 +257,7 @@
          function setBrowserLanguages () {
                  $this->browserLanguages = array();

-            $bLangs = split(',', $_SERVER["HTTP_ACCEPT_LANGUAGE"]);
+            $bLangs = explode(',', $_SERVER["HTTP_ACCEPT_LANGUAGE"]);
              foreach ($bLangs as $lang) {
                          if (strpos($lang, ';') === false)
                                  array_push($this->browserLanguages, 
$lang);



More information about the Mapbender_dev mailing list