RFC compliant CGI AUTH_TYPE usage

* Handle the content of the CGI AUTH_TYPE variable case-insensitively as defined
  by RFC 3875 Section 4.1.1.
This commit is contained in:
Christoph Anton Mitterer authored and Andrew McMillan committed 2013-09-02 14:53:12 +12:00
1 parent c092a6153e
commit 82757beba4
3 files changed
+7 -3

No files matched your search

+2 -2
View File
@@ -114,10 +114,10 @@ class HTTPAuthSession {
else if ( isset($c->authenticate_hook['server_auth_type'])
&& isset($_SERVER['REMOTE_USER']) && !empty($_SERVER['REMOTE_USER'])) {
if ( ( is_array($c->authenticate_hook['server_auth_type'])
&& in_array($_SERVER['AUTH_TYPE'], $c->authenticate_hook['server_auth_type']) )
&& in_array( strtolower($_SERVER['AUTH_TYPE']), array_map('strtolower', $c->authenticate_hook['server_auth_type'])) )
||
( !is_array($c->authenticate_hook['server_auth_type'])
&& $c->authenticate_hook['server_auth_type'] == $_SERVER['AUTH_TYPE'] )
&& strtolower($c->authenticate_hook['server_auth_type']) == strtolower($_SERVER['AUTH_TYPE']) )
) {
/**
* The authentication has happened in the server, and we should accept it.