Handle query string arguments in digest auth data.

Handle &, ? in digest auth data uri.

Refs #4908
This commit is contained in:
mark_story 2014-10-17 23:12:41 -04:00
parent f616667a6f
commit cdc67116c5
2 changed files with 3 additions and 3 deletions

View file

@ -162,7 +162,7 @@ class DigestAuthenticate extends BasicAuthenticate {
} }
$keys = $match = array(); $keys = $match = array();
$req = array('nonce' => 1, 'nc' => 1, 'cnonce' => 1, 'qop' => 1, 'username' => 1, 'uri' => 1, 'response' => 1); $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) { foreach ($match as $i) {
$keys[$i[1]] = $i[3]; $keys[$i[1]] = $i[3];

View file

@ -217,7 +217,7 @@ DIGEST;
Digest username="Mufasa", Digest username="Mufasa",
realm="testrealm@host.com", realm="testrealm@host.com",
nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093", nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093",
uri="/dir/index.html", uri="/dir/index.html?query=string&value=some%20value",
qop=auth, qop=auth,
nc=00000001, nc=00000001,
cnonce="0a4f113b", cnonce="0a4f113b",
@ -228,7 +228,7 @@ DIGEST;
'username' => 'Mufasa', 'username' => 'Mufasa',
'realm' => 'testrealm@host.com', 'realm' => 'testrealm@host.com',
'nonce' => 'dcd98b7102dd2f0e8b11d0f600bfb0c093', 'nonce' => 'dcd98b7102dd2f0e8b11d0f600bfb0c093',
'uri' => '/dir/index.html', 'uri' => '/dir/index.html?query=string&value=some%20value',
'qop' => 'auth', 'qop' => 'auth',
'nc' => '00000001', 'nc' => '00000001',
'cnonce' => '0a4f113b', 'cnonce' => '0a4f113b',