Dear SabreDAV experts,

I'm using Outlook 2010 together with the OutlookCalDAVSynchronizer
to change calendar events in our SabreDAV server.

Synchronizsation fails with the following error message:

CalDavSynchronizer.DataAccess.WebDavClientException: Response status code 
does not indicate success: '415' ('UnsupportedMediaType'). Message:
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns";>
<s:sabredav-version>3.2.0-beta1</s:sabredav-version>
<s:exception>Sabre\DAV\Exception\UnsupportedMediaType</s:exception>
<s:message>Validation error in iCalendar: Invalid value for BYMINUTE in 
RRULE, Raw=FREQ=YEARLY;BYDAY=-1SU;BYHOUR=2;BYMINUTE=0;BYMONTH=10</s:message>
</d:error>

I searched the SabreDAV source for the string 'Invalid value for' and
found it in sabre/vobject/lib/Property/ICalendar/Recur.php at line 266.

SabreDAV chokes on a BYMINUTE-value, so I replaced line 266
'message' => 'Invalid value for ' . $key . ' in ' . $this->name,
with
'message' => 'Invalid value for ' . $key . ' in ' . $this->name . ', Raw=' 
. $this->getRawMimeDirValue(),

Seems like SabreDAV doesn't like BYMINUTE=0 in RRULE

Have a look at line 265:
if (empty($value)) {

Every programmer would expect that empty($var) checks wether $var is
empty or not. So did I for a couple of times in my own programs just to
learn that PHP has a strange interpretation of emtpyness.
empty() returns true if the argument does not exist or has a value that
evaluates to FALSE when casted to boolean. This has the unexpected
consequence that empty("0") is true.

I changed line 265 into: if($value==""){ and the error disappeared.

By the way: I searched through all of SabreDAVs source and found similar
usages of empty(). Maybe there are other places where empty($var)
should be changed.

Kind regards

Peter

-- 
You received this message because you are subscribed to the Google Groups 
"SabreDAV Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sabredav-discuss/f5d4592c-60fa-4a76-95ea-fdc6f18c1757%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to