diff --git a/features/http-auth.xml b/features/http-auth.xml index 128536ba93..cb2d1d4ff8 100644 --- a/features/http-auth.xml +++ b/features/http-auth.xml @@ -1,5 +1,5 @@ - + HTTP authentication with PHP @@ -107,10 +107,10 @@ function http_digest_parse($txt) $needed_parts = array('nonce'=>1, 'nc'=>1, 'cnonce'=>1, 'qop'=>1, 'username'=>1, 'uri'=>1, 'response'=>1); $data = array(); - preg_match_all('@(\w+)=([\'"]?)([a-zA-Z0-9=./\_-]+)\2@', $txt, $matches, PREG_SET_ORDER); + preg_match_all('@(\w+)=(?:([\'"])([^\2]+)\2|([^\s,]+))@', $txt, $matches, PREG_SET_ORDER); foreach ($matches as $m) { - $data[$m[1]] = $m[3]; + $data[$m[1]] = $m[3] ? $m[3] : $m[4]; unset($needed_parts[$m[1]]); }