From 8f8c8c68906e8568b15244341e29a8f5a13b0354 Mon Sep 17 00:00:00 2001 From: Richard Quadling Date: Wed, 8 Jul 2009 08:20:50 +0000 Subject: [PATCH] Fix regex for bug#48836 git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@283700 c90b9560-bf6c-de11-be94-00142212c4b1 --- features/http-auth.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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];