mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Normalize request header names.
This commit is contained in:
parent
ba774b42a2
commit
3f4ac1eb9a
1 changed files with 7 additions and 1 deletions
|
@ -754,7 +754,13 @@ class OAuthUtil {
|
||||||
if (function_exists('apache_request_headers')) {
|
if (function_exists('apache_request_headers')) {
|
||||||
// we need this to get the actual Authorization: header
|
// we need this to get the actual Authorization: header
|
||||||
// because apache tends to tell us it doesn't exist
|
// because apache tends to tell us it doesn't exist
|
||||||
return apache_request_headers();
|
$in = apache_request_headers();
|
||||||
|
$out = array();
|
||||||
|
foreach ($in as $key => $value) {
|
||||||
|
$key = str_replace(" ", "-", ucwords(strtolower(str_replace("-", " ", $key))));
|
||||||
|
$out[$key] = $value;
|
||||||
|
}
|
||||||
|
return $out;
|
||||||
}
|
}
|
||||||
// otherwise we don't have apache and are just going to have to hope
|
// otherwise we don't have apache and are just going to have to hope
|
||||||
// that $_SERVER actually contains what we need
|
// that $_SERVER actually contains what we need
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue