Fixed some major bugs in getting the folder list. Might fix the problem with the...
[squirrelmail.git] / functions / strings.php
index 5c633d444bec5cac7b5a8d1979034d9a94d7f7a3..11e30f924563c2007b22128f77caeb6fb72f89e2 100644 (file)
@@ -17,6 +17,9 @@
    //    of the $haystack is reached.
    //*************************************************************************
    function readShortMailboxName($haystack, $needle) {
+      if (substr($haystack, -1) == $needle)
+         $haystack = substr($haystack, 0, strlen($haystack) - 1);
+
       if (strpos($haystack, $needle)) {
          $pos = strrpos($haystack, $needle) + 1;
          $data = substr($haystack, $pos, strlen($haystack));