diff options
author | Simon Rettberg | 2017-04-18 13:03:38 +0200 |
---|---|---|
committer | Simon Rettberg | 2017-04-18 13:03:38 +0200 |
commit | ae0880886d0cc67bac01952d6f0f9dbc516a56e8 (patch) | |
tree | 6991b413ba5cc2149cf37929099cea650af447ce /modules-available/locationinfo/inc | |
parent | [locationinfo] Remove more dead code, refactor javascript, (diff) | |
download | slx-admin-ae0880886d0cc67bac01952d6f0f9dbc516a56e8.tar.gz slx-admin-ae0880886d0cc67bac01952d6f0f9dbc516a56e8.tar.xz slx-admin-ae0880886d0cc67bac01952d6f0f9dbc516a56e8.zip |
[locationinfo] Davinci: Fix requested timespan, use single quotes for regex with backslashes to prevent evaluation by php
Diffstat (limited to 'modules-available/locationinfo/inc')
-rw-r--r-- | modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php b/modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php index 2d53e762..11882a1e 100644 --- a/modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php +++ b/modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php @@ -56,7 +56,7 @@ class Coursebackend_Davinci extends CourseBackend private function toArray($response) { try { - $cleanresponse = preg_replace("/(<\/?)(\w+):([^>]*>)/", "$1$2$3", $response); + $cleanresponse = preg_replace('/(<\/?)(\w+):([^>]*>)/', "$1$2$3", $response); $xml = new SimpleXMLElement($cleanresponse); $array = json_decode(json_encode((array)$xml), true); } catch (Exception $exception) { @@ -73,8 +73,8 @@ class Coursebackend_Davinci extends CourseBackend */ private function fetchArray($roomId) { - $startDate = new DateTime('monday this week'); - $endDate = new DateTime('sunday'); + $startDate = new DateTime('today 0:00'); + $endDate = new DateTime('+7 days 0:00'); $url = $this->location . "content=xml&type=room&name=" . $roomId . "&startdate=" . $startDate->format('d.m.Y') . "&enddate=" . $endDate->format('d.m.Y'); $ch = curl_init(); $options = array( @@ -97,6 +97,7 @@ class Coursebackend_Davinci extends CourseBackend ///Operation completed successfully } curl_close($ch); + error_log($output); return $this->toArray($output); } |