We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3ab4aa6 + 0a30275 commit a118ce8Copy full SHA for a118ce8
inc/auth.php
@@ -190,11 +190,18 @@ function auth_tokenlogin()
190
global $auth;
191
if (!$auth) return false;
192
193
- // get the headers, either from Apache or from $_SERVER
+ $headers = [];
194
+
195
+ // try to get the headers from Apache
196
if (function_exists('getallheaders')) {
- $headers = array_change_key_case(getallheaders());
- } else {
197
- $headers = [];
+ $headers = getallheaders();
198
+ if (is_array($headers)) {
199
+ $headers = array_change_key_case($headers);
200
+ }
201
202
203
+ // get the headers from $_SERVER
204
+ if (!$headers) {
205
foreach ($_SERVER as $key => $value) {
206
if (substr($key, 0, 5) === 'HTTP_') {
207
$headers[strtolower(substr($key, 5))] = $value;
0 commit comments