Commit 826d6c47 authored by Chris Pitchford's avatar Chris Pitchford

ZP-1244 use strcasecmp to compare CALDAV_PERSONAL and calendar id

If CALDAV_PERSONAL is defined with upper-case characters, a match would be impossible
Now, it will match by comparing case-insensitively.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 16c9740c
...@@ -150,7 +150,7 @@ class BackendCalDAV extends BackendDiff { ...@@ -150,7 +150,7 @@ class BackendCalDAV extends BackendDiff {
$folder->displayname = $val->displayname; $folder->displayname = $val->displayname;
$folder->serverid = $id; $folder->serverid = $id;
if ($id[0] == "C") { if ($id[0] == "C") {
if (defined('CALDAV_PERSONAL') && strtolower(substr($id, 1)) == CALDAV_PERSONAL) { if (defined('CALDAV_PERSONAL') && strcasecmp(substr($id, 1), CALDAV_PERSONAL) == 0) {
$folder->type = SYNC_FOLDER_TYPE_APPOINTMENT; $folder->type = SYNC_FOLDER_TYPE_APPOINTMENT;
} }
else { else {
...@@ -158,7 +158,7 @@ class BackendCalDAV extends BackendDiff { ...@@ -158,7 +158,7 @@ class BackendCalDAV extends BackendDiff {
} }
} }
else { else {
if (defined('CALDAV_PERSONAL') && strtolower(substr($id, 1)) == CALDAV_PERSONAL) { if (defined('CALDAV_PERSONAL') && strcasecmp(substr($id, 1), CALDAV_PERSONAL) == 0) {
$folder->type = SYNC_FOLDER_TYPE_TASK; $folder->type = SYNC_FOLDER_TYPE_TASK;
} }
else { else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment