MDL-60161 class curl in filelib: Avoid duplicate params in http header

This commit is contained in:
Carson Tam 2017-09-28 08:46:31 -07:00 committed by Adrian Greeve
parent 109aa07648
commit a2b66c7833

View File

@ -3036,7 +3036,10 @@ class curl {
}
} else {
// Remove newlines, they are not allowed in headers.
$this->header[] = preg_replace('/[\r\n]/', '', $header);
$newvalue = preg_replace('/[\r\n]/', '', $header);
if (!in_array($newvalue, $this->header)) {
$this->header[] = $newvalue;
}
}
}