MDL-71920 core: update filelib opt name definition

This commit is contained in:
Mathew May 2022-11-09 14:15:32 +08:00 committed by Jun Pataleta
parent f865b326ca
commit fbe1ac8e13

View file

@ -3332,7 +3332,11 @@ class curl {
throw new coding_exception('Curl options should be defined using strings, not constant values.');
}
if (stripos($name, 'CURLOPT_') === false) {
$name = strtoupper('CURLOPT_'.$name);
// Only prefix with CURLOPT_ if the option doesn't contain CURLINFO_,
// which is a valid prefix for at least one option CURLINFO_HEADER_OUT.
if (stripos($name, 'CURLINFO_') === false) {
$name = strtoupper('CURLOPT_'.$name);
}
} else {
$name = strtoupper($name);
}