aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc/HTTP
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2022-10-19 15:18:31 +0200
committerAndreas Gohr <andi@splitbrain.org>2022-10-19 15:29:26 +0200
commitec34bb300b254ecd0dba0fac22d8115635141cc5 (patch)
tree5d5eac1d0d57ca7af03a1475c74fc3dcef6b6829 /inc/HTTP
parent12dd3cbcf3c49223eacbd75f1d4ae9c83b326deb (diff)
downloaddokuwiki-ec34bb300b254ecd0dba0fac22d8115635141cc5.tar.gz
dokuwiki-ec34bb300b254ecd0dba0fac22d8115635141cc5.zip
Update core code to make use of sexplode()
This makes use of our own explode mechanism everywhere were we expect a fixed number of results.
Diffstat (limited to 'inc/HTTP')
-rw-r--r--inc/HTTP/HTTPClient.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/inc/HTTP/HTTPClient.php b/inc/HTTP/HTTPClient.php
index 5c7491ee9..ee8e7e7b3 100644
--- a/inc/HTTP/HTTPClient.php
+++ b/inc/HTTP/HTTPClient.php
@@ -340,8 +340,8 @@ class HTTPClient {
$this->resp_headers = $this->parseHeaders($r_headers);
if(isset($this->resp_headers['set-cookie'])){
foreach ((array) $this->resp_headers['set-cookie'] as $cookie){
- list($cookie) = explode(';',$cookie,2);
- list($key,$val) = explode('=',$cookie,2);
+ list($cookie) = sexplode(';', $cookie, 2, '');
+ list($key, $val) = sexplode('=', $cookie, 2, '');
$key = trim($key);
if($val == 'deleted'){
if(isset($this->cookies[$key])){
@@ -770,9 +770,9 @@ class HTTPClient {
$lines = explode("\n",$string);
array_shift($lines); //skip first line (status)
foreach($lines as $line){
- @list($key, $val) = explode(':',$line,2);
+ list($key, $val) = sexplode(':', $line, 2, '');
$key = trim($key);
- $val = trim($val ?? '');
+ $val = trim($val);
$key = strtolower($key);
if(!$key) continue;
if(isset($headers[$key])){