From 7333082dd863c72d792bcc202f636a485c5a2e18 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 13 Sep 2013 09:47:40 +0200 Subject: [PATCH] Fix PHP fatal error when Sabre/VObject is not in include path (Bug #2214) --- plugins/libcalendaring/libvcalendar.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/libcalendaring/libvcalendar.php b/plugins/libcalendaring/libvcalendar.php index 845cfbd4..bf7c322f 100644 --- a/plugins/libcalendaring/libvcalendar.php +++ b/plugins/libcalendaring/libvcalendar.php @@ -23,6 +23,11 @@ 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 * @@ -50,11 +55,6 @@ class libvcalendar */ 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->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 * because Apple clients treat that property as list. @@ -880,4 +881,3 @@ class vobject_location_property extends VObject\Property return $out; } } -