aboutsummaryrefslogtreecommitdiffstats
path: root/apps/calendar/ajax/events.php
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-03-03 14:30:52 +0100
committerGeorg Ehrke <dev@georgswebsite.de>2012-03-03 14:30:52 +0100
commit4c45483ad3acd5b675e54893686f912a32f10a12 (patch)
treeadac2f94428bc688288211cf2c8457680a40b9bb /apps/calendar/ajax/events.php
parent23b64cd9cee55b6b17fa8dec44d1cb8d06e88af8 (diff)
downloadnextcloud-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-xapps/calendar/ajax/events.php9
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)) {