summaryrefslogtreecommitdiff
path: root/lib/Kolab/Utils/DAVBackend.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Kolab/Utils/DAVBackend.php')
-rw-r--r--lib/Kolab/Utils/DAVBackend.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/Kolab/Utils/DAVBackend.php b/lib/Kolab/Utils/DAVBackend.php
index 1111216..0989032 100644
--- a/lib/Kolab/Utils/DAVBackend.php
+++ b/lib/Kolab/Utils/DAVBackend.php
@@ -143,9 +143,13 @@ class DAVBackend
foreach ($mutations as $prop => $val) {
switch ($prop) {
case '{DAV:}displayname':
+ // abort if name didn't change
+ if ($val == html_entity_decode($folder->get_name(), ENT_COMPAT, RCUBE_CHARSET)) {
+ break;
+ }
// restrict renaming to personal folders only
if ($folder->get_namespace() == 'personal') {
- $parts = preg_split('!(\s*/\s*|\s+[:]\s+)!', $val);
+ $parts = preg_split('!(\s*/\s*|\s+[»:]\s+)!', $val);
$updates['oldname'] = $folder->name;
$updates['name'] = array_pop($parts);
$updates['parent'] = join('/', $parts);
@@ -156,7 +160,10 @@ class DAVBackend
break;
case '{http://apple.com/ns/ical/}calendar-color':
- $updates['color'] = substr(trim($val, '#'), 0, 6);
+ $newcolor = substr(trim($val, '#'), 0, 6);
+ if (strcasecmp($newcolor, $folder->get_color())) {
+ $updates['color'] = $newcolor;
+ }
break;
case '{urn:ietf:params:xml:ns:caldav}calendar-description':