diff options
author | Georg Ehrke <dev@georgswebsite.de> | 2012-03-03 14:30:52 +0100 |
---|---|---|
committer | Georg Ehrke <dev@georgswebsite.de> | 2012-03-03 14:30:52 +0100 |
commit | 4c45483ad3acd5b675e54893686f912a32f10a12 (patch) | |
tree | adac2f94428bc688288211cf2c8457680a40b9bb /apps/calendar/ajax/events.php | |
parent | 23b64cd9cee55b6b17fa8dec44d1cb8d06e88af8 (diff) | |
download | nextcloud-server-4c45483ad3acd5b675e54893686f912a32f10a12.tar.gz nextcloud-server-4c45483ad3acd5b675e54893686f912a32f10a12.zip |
make calendar compatible with php 5.2 - works for me with PHP 5.2.12
Diffstat (limited to 'apps/calendar/ajax/events.php')
-rwxr-xr-x | apps/calendar/ajax/events.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/calendar/ajax/events.php b/apps/calendar/ajax/events.php index a912889f292..922df90b76b 100755 --- a/apps/calendar/ajax/events.php +++ b/apps/calendar/ajax/events.php @@ -27,8 +27,13 @@ function create_return_event($event, $vevent){ OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); -$start = DateTime::createFromFormat('U', $_GET['start']); -$end = DateTime::createFromFormat('U', $_GET['end']); +if(version_compare(PHP_VERSION, '5.3.0', '>=')){ + $start = DateTime::createFromFormat('U', $_GET['start']); + $end = DateTime::createFromFormat('U', $_GET['end']); +}else{ + $start = new DateTime('@' . $_GET['start']); + $end = new DateTime('@' . $_GET['end']); +} $calendar_id = $_GET['calendar_id']; if (is_numeric($calendar_id)) { |