Donate Share

WebCalendar

Tracker: Bugs

5 Duplicate entries from iCal client - ID: 2041908
Last Update: Comment added ( marcovanbeek )

When you add an entry in the Web Interface, it exports fine to the iCal
client, and the UID of the entry has a HTTPS:- bit at the front of it eg:
UID:HTTPS:-AA000019-UK-FABIT-NET-WEBCALENDAR-MVANBEEK-0000000019

When the entry is edited in the iCal client (eg Sunbird) and the calendar
is saved back, a new entry is created. It looks like the "HTTPS:" bit of
the UID is getting stripped out by the icalclient.php script as in the
example above, the new entry has a UID of:
UID:-AA000019-UK-FABIT-NET-WEBCALENDAR-MVANBEEK-0000000019

I think the problem is in the regular expression match and the ":" in the
UID, so perhaps the exported file UID should not have the HTTPS bit in
front of it. So it looks like the problem is in the generate_uid() function
in includes/xcal.php


Marco van Beek ( marcovanbeek ) - 2008-08-07 17:00

5

Open

None

Nobody/Anonymous

None

None

Public


Comments ( 2 )

Date: 2008-08-08 17:23
Sender: marcovanbeek


I think I have worked out a bug fix for this problem. in
./includes/xcal.php you need to change the line in the generate_uid
function that says:

$uid = str_replace ( 'http://', ' ', $uid );

with

$uid = str_ireplace ( 'http://', ' ', $uid );
$uid = str_ireplace ( 'https://', ' ', $uid );

If you do this with an existing calendar you will get another load of
duplicates after it syncs with the iCal client. But at least it seems to
stay fixed so far.
File Added: xcal.php


Date: 2008-08-07 20:34
Sender: marcovanbeek


I think I have tracked the issue down to the use of the SERVER_URL
variable. In ./install/index.php there is a chunk of code regarding this.
In it, it assumes that the page is running http, and doesn't check if it is
running https. In generate_url it tries to strip out this part of the URL,
but I am not sure this works. In the system settings page it correctly uses
the https:// part of the url. I am going to try the following:

a) modify generate_url to use the case insensitive version of str_replace
(str_ireplace)
b) modify generale_url to strip out https as well as http.

Since this code saves information to a session variable I may have to shut
down my browser each time I test it.


Attached File ( 1 )

Filename Description Download
xcal.php Revised file with bug fix Download

Change ( 1 )

Field Old Value Date By
File Added 287725: xcal.php 2008-08-08 17:23 marcovanbeek