From 8b7e3972fa6f563ccbefcf42059ab4447ff45489 Mon Sep 17 00:00:00 2001 From: Stricted Date: Mon, 20 Jul 2015 14:53:22 +0200 Subject: [PATCH] apply small fix for syslos --- SpeedportHybrid.class.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/SpeedportHybrid.class.php b/SpeedportHybrid.class.php index 146c36f..adc668b 100644 --- a/SpeedportHybrid.class.php +++ b/SpeedportHybrid.class.php @@ -391,11 +391,17 @@ class SpeedportHybrid { private function getValues($array) { $data = array(); foreach ($array as $item) { - if (is_array($item['varvalue'])) { + // thank you telekom for this piece of bullshit + if ($item['vartype'] == 'template') { $data[$item['varid']] = $this->getValues($item['varvalue']); } else { - $data[$item['varid']] = $item['varvalue']; + if (is_array($item['varvalue'])) { + $data[$item['varid']] = $this->getValues($item['varvalue']); + } + else { + $data[$item['varid']] = $item['varvalue']; + } } } @@ -442,7 +448,7 @@ class SpeedportHybrid { } if ($cookie === true) { - curl_setopt($ch, CURLOPT_COOKIE, 'challengev='.$this->challenge.'; '.$this->cookie); + curl_setopt($ch, CURLOPT_COOKIE, 'lang=en; challengev='.$this->challenge.'; '.$this->cookie); } curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); @@ -476,7 +482,7 @@ class SpeedportHybrid { $body = preg_replace("/},\s+]/", "}\n]", $body); // decode json - if (strpos($url, '.json') !== false) { + if (strpos($url, '.json') !== false && strpos($url, 'Syslog.json') === false) { $body = json_decode($body, true); } -- 2.20.1