0012586: delimiter could be empty when extracting folder
authorPhilipp Schüle <p.schuele@metaways.de>
Fri, 27 Jan 2017 17:46:33 +0000 (18:46 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Tue, 31 Jan 2017 13:12:53 +0000 (14:12 +0100)
https://forge.tine20.org/view.php?id=12586

Change-Id: Ia036c8c7b00739411fb96258e75bb5849f815b3f
Reviewed-on: http://gerrit.tine20.com/customers/4145
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Felamimail/Model/Folder.php

index b5a700c..7c23c08 100644 (file)
@@ -219,7 +219,7 @@ class Felamimail_Model_Folder extends Tinebase_Record_Abstract
      */
     public static function extractLocalnameAndParent($_folderName, $_delimiter)
     {
-        $globalNameParts = explode($_delimiter, $_folderName);
+        $globalNameParts = ($_delimiter && $_delimiter != '') ? explode($_delimiter, $_folderName) : array($_folderName);
         $localname = array_pop($globalNameParts);
         $parent = (count($globalNameParts) > 0) ? implode($_delimiter, $globalNameParts) : '';