Commit e0725c3b authored by berliner's avatar berliner Committed by mikeytown2

Issue #2784185 by berliner: Problems with Basic Auth using nginx

parent 64035591
......@@ -313,7 +313,9 @@ function _httprl_build_drupal_root($level = 0, $hostname_mode = 0) {
if (module_exists('shield')) {
$auth = variable_get('shield_user', '') . ':' . variable_get('shield_pass', '') . '@';
}
elseif (isset($_SERVER['AUTH_TYPE']) && $_SERVER['AUTH_TYPE'] == 'Basic') {
elseif ((isset($_SERVER['AUTH_TYPE']) && $_SERVER['AUTH_TYPE'] == 'Basic')
|| (isset($_SERVER['HTTP_AUTHORIZATION']) && preg_match('/Basic\s+(.*)$/i', $_SERVER['HTTP_AUTHORIZATION']))
) {
$auth = $_SERVER['PHP_AUTH_USER'] . ':' . $_SERVER['PHP_AUTH_PW'] . '@';
}
// Use static for gethostbyname lookup.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment