MDL-71920 core: update filelib opt name definition

This commit is contained in:
Mathew May
2022-11-11 12:54:11 +08:00
committed by Jun Pataleta
parent 56a9861094
commit e3ce8c37bd
+5 -1
View File
@@ -3299,7 +3299,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);
}