diff --git a/features/http-auth.xml b/features/http-auth.xml index 41cbfd80f4..cc9e9a8e2b 100644 --- a/features/http-auth.xml +++ b/features/http-auth.xml @@ -1,5 +1,5 @@ - + HTTP authentication with PHP @@ -105,8 +105,9 @@ function http_digest_parse($txt) // protect against missing data $needed_parts = array('nonce'=>1, 'nc'=>1, 'cnonce'=>1, 'qop'=>1, 'username'=>1, 'uri'=>1, 'response'=>1); $data = array(); + $keys = implode('|', array_keys($needed_parts)); - preg_match_all('@(\w+)=(?:([\'"])([^\2]+)\2|([^\s,]+))@', $txt, $matches, PREG_SET_ORDER); + preg_match_all('@(' . $keys . ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@', $txt, $matches, PREG_SET_ORDER); foreach ($matches as $m) { $data[$m[1]] = $m[3] ? $m[3] : $m[4];