Fix support for imap hierarchy delimiter different than a slash char (Bifrost#T71208)

This commit is contained in:
Aleksander Machniak 2018-05-03 10:32:51 +00:00
parent 741ba7afbd
commit ce097cdbef
2 changed files with 8 additions and 4 deletions

View file

@ -38,7 +38,8 @@ class kolab_user_calendar extends kolab_calendar
*/
public function __construct($user_or_folder, $calendar)
{
$this->cal = $calendar;
$this->cal = $calendar;
$this->imap = $calendar->rc->get_storage();
// full user record is provided
if (is_array($user_or_folder)) {

View file

@ -157,7 +157,8 @@ abstract class kolab_storage_folder_api
*/
public function get_foldername()
{
$parts = explode('/', $this->name);
$parts = explode($this->imap->get_hierarchy_delimiter(), $this->name);
return rcube_charset::convert(end($parts), 'UTF7-IMAP');
}
@ -168,7 +169,9 @@ abstract class kolab_storage_folder_api
*/
public function get_parent()
{
$path = explode('/', $this->name);
$delim = $this->imap->get_hierarchy_delimiter();
$path = explode($delim, $this->name);
array_pop($path);
// don't list top-level namespace folder
@ -176,7 +179,7 @@ abstract class kolab_storage_folder_api
$path = array();
}
return join('/', $path);
return join($delim, $path);
}
/**