Fix PHP fatal error when Sabre/VObject is not in include path (Bug #2214)

This commit is contained in:
Aleksander Machniak 2013-09-13 09:47:40 +02:00
parent 0f864cfd25
commit 7333082dd8

View file

@ -23,6 +23,11 @@
use \Sabre\VObject; use \Sabre\VObject;
// load Sabre\VObject classes
if (!class_exists('\Sabre\VObject\Reader')) {
require_once __DIR__ . '/lib/Sabre/VObject/includes.php';
}
/** /**
* Class to parse and build vCalendar (iCalendar) files * Class to parse and build vCalendar (iCalendar) files
* *
@ -50,11 +55,6 @@ class libvcalendar
*/ */
function __construct($tz = null) function __construct($tz = null)
{ {
// load Sabre\VObject classes
if (!class_exists('\Sabre\VObject\Reader')) {
require_once(__DIR__ . '/lib/Sabre/VObject/includes.php');
}
$this->timezone = $tz; $this->timezone = $tz;
$this->prodid = '-//Roundcube//Roundcube libcalendaring ' . RCUBE_VERSION . '//Sabre//Sabre VObject ' . VObject\Version::VERSION . '//EN'; $this->prodid = '-//Roundcube//Roundcube libcalendaring ' . RCUBE_VERSION . '//Sabre//Sabre VObject ' . VObject\Version::VERSION . '//EN';
} }
@ -834,6 +834,7 @@ class libvcalendar
} }
/** /**
* Override Sabre\VObject\Property that quotes commas in the location property * Override Sabre\VObject\Property that quotes commas in the location property
* because Apple clients treat that property as list. * because Apple clients treat that property as list.
@ -880,4 +881,3 @@ class vobject_location_property extends VObject\Property
return $out; return $out;
} }
} }