Branch 'roundcubemail-plugins-kolab-3.1' - plugins/libcalendaring
Thomas Brüderli
bruederli at kolabsys.com
Mon Nov 24 11:31:46 CET 2014
plugins/libcalendaring/libcalendaring.php | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
New commits:
commit f07c4f07c768965263fdd802cb5168f13491ad1c
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date: Mon Nov 24 11:31:38 2014 +0100
Catch errors in alarms routine when invalid event/task objects are passed to the function (#3956)
diff --git a/plugins/libcalendaring/libcalendaring.php b/plugins/libcalendaring/libcalendaring.php
index c96807f..be807be 100644
--- a/plugins/libcalendaring/libcalendaring.php
+++ b/plugins/libcalendaring/libcalendaring.php
@@ -410,7 +410,26 @@ class libcalendaring extends rcube_plugin
}
$offset = $notify[0] * $mult;
$refdate = $mult > 0 ? $rec['end'] : $rec['start'];
- $notify_at = $refdate->format('U') + $offset;
+
+ if ($refdate && is_a($refdate, 'DateTime')) {
+ $notify_at = $refdate->format('U') + $offset;
+ }
+ else {
+ rcube::raise_error(array(
+ 'code' => 600,
+ 'type' => 'php',
+ 'file' => __FILE__,
+ 'line' => __LINE__,
+ 'message' => sprintf("Invalid reference date for alarm: %s; type=%s; start=%s; end=%s; uid=%s",
+ $trigger,
+ $type,
+ var_export($rec['start'], true),
+ var_export($rec['end'], true),
+ $rec['uid']
+ )),
+ true, false);
+ return null;
+ }
}
else { // absolute timestamp
$notify_at = $notify[0];
More information about the commits
mailing list