nlopess         Wed Nov  1 15:37:09 2006 UTC

  Modified files:              
    /phpdoc/en/features http-auth.xml 
  Log:
  fix #39154: improve http digest auth regex
  
http://cvs.php.net/viewvc.cgi/phpdoc/en/features/http-auth.xml?r1=1.47&r2=1.48&diff_format=u
Index: phpdoc/en/features/http-auth.xml
diff -u phpdoc/en/features/http-auth.xml:1.47 
phpdoc/en/features/http-auth.xml:1.48
--- phpdoc/en/features/http-auth.xml:1.47       Wed Aug 16 04:07:22 2006
+++ phpdoc/en/features/http-auth.xml    Wed Nov  1 15:37:09 2006
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.47 $ -->
+<!-- $Revision: 1.48 $ -->
  <chapter id="features.http-auth">
   <title>HTTP authentication with PHP</title>
 
@@ -107,10 +107,10 @@
     $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]]);
     }
 

Reply via email to