Permalink
Browse files

Handle query string arguments in digest auth data.

Handle &, ? in digest auth data uri.

Refs #4908
  • Loading branch information...
markstory committed Oct 18, 2014
1 parent f616667 commit cdc67116c5e9ebba67a76045434e7b6fb7d1876b
@@ -162,7 +162,7 @@ public function parseAuthData($digest) {
}
$keys = $match = array();
$req = array('nonce' => 1, 'nc' => 1, 'cnonce' => 1, 'qop' => 1, 'username' => 1, 'uri' => 1, 'response' => 1);
preg_match_all('/(\w+)=([\'"]?)([a-zA-Z0-9\:\#\%@=.\/_-]+)\2/', $digest, $match, PREG_SET_ORDER);
preg_match_all('/(\w+)=([\'"]?)([a-zA-Z0-9\:\#\%\?\&@=\.\/_-]+)\2/', $digest, $match, PREG_SET_ORDER);
foreach ($match as $i) {
$keys[$i[1]] = $i[3];
@@ -217,7 +217,7 @@ public function testParseAuthData() {
Digest username="Mufasa",
realm="testrealm@host.com",
nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093",
uri="/dir/index.html",
uri="/dir/index.html?query=string&value=some%20value",
qop=auth,
nc=00000001,
cnonce="0a4f113b",
@@ -228,7 +228,7 @@ public function testParseAuthData() {
'username' => 'Mufasa',
'realm' => 'testrealm@host.com',
'nonce' => 'dcd98b7102dd2f0e8b11d0f600bfb0c093',
'uri' => '/dir/index.html',
'uri' => '/dir/index.html?query=string&value=some%20value',
'qop' => 'auth',
'nc' => '00000001',
'cnonce' => '0a4f113b',

0 comments on commit cdc6711

Please sign in to comment.