summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2017-04-18 13:03:38 +0200
committerSimon Rettberg2017-04-18 13:03:38 +0200
commitae0880886d0cc67bac01952d6f0f9dbc516a56e8 (patch)
tree6991b413ba5cc2149cf37929099cea650af447ce /modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php
parent[locationinfo] Remove more dead code, refactor javascript, (diff)
downloadslx-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/coursebackend/coursebackend_davinci.inc.php')
-rw-r--r--modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php7
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);
}