MDL-47198 filelib: fix curl handling headers with no value
This commit is contained in:
committed by
Eloy Lafuente (stronk7)
parent
c5f11c0f3c
commit
31e4c05002
+3
-2
@@ -3056,8 +3056,9 @@ class curl {
|
||||
$this->responsefinished = false;
|
||||
$this->response = array();
|
||||
}
|
||||
list($key, $value) = explode(" ", rtrim($header, "\r\n"), 2);
|
||||
$key = rtrim($key, ':');
|
||||
$parts = explode(" ", rtrim($header, "\r\n"), 2);
|
||||
$key = rtrim($parts[0], ':');
|
||||
$value = isset($parts[1]) ? $parts[1] : null;
|
||||
if (!empty($this->response[$key])) {
|
||||
if (is_array($this->response[$key])) {
|
||||
$this->response[$key][] = $value;
|
||||
|
||||
Reference in New Issue
Block a user