From: Stricted Date: Mon, 20 Jul 2015 12:53:22 +0000 (+0200) Subject: apply small fix for syslos X-Git-Tag: 1.0.4~13 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8b7e3972fa6f563ccbefcf42059ab4447ff45489;p=GitHub%2FStricted%2Fspeedport-hybrid-php-api.git apply small fix for syslos --- 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); }