From 8ab4410bc8795dd26f6f699fd8377dbd223eb2f8 Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Wed, 1 Nov 2006 15:37:09 +0000 Subject: [PATCH] fix #39154: improve http digest auth regex git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@222638 c90b9560-bf6c-de11-be94-00142212c4b1 --- features/http-auth.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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]]); }