]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/ParameterParser.php
Merge pull request #969 from mtmail/update-vagrant-md
[nominatim.git] / lib / ParameterParser.php
index 2eed1629b04742ad274c6ac9f5cf8d9bf1ebfbd3..c9a97c25c5f6b0f29f0e9cb3b139b32e8f9d2841 100644 (file)
@@ -23,7 +23,7 @@ class ParameterParser
 
     public function getInt($sName, $bDefault = false)
     {
-        if (!isset($this->aParams[$sName]) || strlen($this->aParams[$sName]) == 0) {
+        if (!isset($this->aParams[$sName])) {
             return $bDefault;
         }
 
@@ -36,7 +36,7 @@ class ParameterParser
 
     public function getFloat($sName, $bDefault = false)
     {
-        if (!isset($this->aParams[$sName]) || strlen($this->aParams[$sName]) == 0) {
+        if (!isset($this->aParams[$sName])) {
             return $bDefault;
         }
 
@@ -74,7 +74,8 @@ class ParameterParser
         $sValue = $this->getString($sName);
 
         if ($sValue) {
-            return explode(',', $sValue);
+            // removes all NULL, FALSE and Empty Strings but leaves 0 (zero) values
+            return array_values(array_filter(explode(',', $sValue), 'strlen'));
         }
 
         return $aDefault;