Fixed bug in readShortMailboxName() if "needle" (delimiter) is empty.
[squirrelmail.git] / functions / strings.php
index 7e42437502a01b40267c6b17cf3eae067d02ed6a..fc466528e902e0805844f777bd16c457e0af6620 100644 (file)
@@ -15,6 +15,7 @@
    //    of the $haystack is reached.  $needle is a single character
    //*************************************************************************
    function readShortMailboxName($haystack, $needle) {
+      if ($needle == "") return $haystack;
       if ($needle == ".") $needle = "\.";
       ereg("([^$needle]+)$needle?$", $haystack, $regs);
       return $regs[1];