CRM-16333 - explodePadded should return an empty array from an empty string
authorColeman Watts <coleman@civicrm.org>
Thu, 30 Apr 2015 14:15:57 +0000 (08:15 -0600)
committerColeman Watts <coleman@civicrm.org>
Thu, 30 Apr 2015 14:15:57 +0000 (08:15 -0600)
CRM/Utils/Array.php

index 927b9670b8cbe62b5fdb184c035ec0dabcf21f2e..fa658f68818a0234d45d8e13eb79ba594ebe19ca 100644 (file)
@@ -639,6 +639,10 @@ class CRM_Utils_Array {
     if (is_array($values)) {
       return $values;
     }
+    // Empty string -> empty array
+    if ($values === '') {
+      return array();
+    }
     return explode($delim, trim((string) $values, $delim));
   }