note 85449 added to features.http-auth
| From: | fakeraol at hotmail dot com | Date: | Sun, 31 Aug 2008 22:35:44 +0000 |
| Subject: | note 85449 added to features.http-auth | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-144032@lists.php.net to get a copy of this message | ||
digest-example does not work because of a bad regex in the function "http_digest_parse".
this will do the job (not optimized):
<?
function http_digest_parse($txt) {
$search = array(',','"',"'");
$replace = array('&');
$php_auth_digest=str_replace($search,$replace,$txt);
parse_str($txt,$return);
$return=str_replace(' ','%20',$return);
$noetige_teile =
array('nonce'=>1,'nc'=>1,'cnonce'=>1,'qop'=>1,
'username'=>1,'uri'=>1,'response'=>1);
$return = array_intersect_key($return,$noetige_teile);
return (count($return)==7) ? $return : false;
}
?>
alextm84 at gmail dot com code does not work for IE due to different order of parameters, send by
IE. needs to be split in separate searches for every parameter.
----
Server IP: 212.124.37.9
Probable Submitter: 90.128.103.121
----
Manual Page -- http://www.php.net/manual/en/features.http-auth.php
Edit -- https://master.php.net/note/edit/85449
Del: integrated -- https://master.php.net/note/delete/85449/integrated
Del: useless -- https://master.php.net/note/delete/85449/useless
Del: bad code -- https://master.php.net/note/delete/85449/bad+code
Del: spam -- https://master.php.net/note/delete/85449/spam
Del: non-english -- https://master.php.net/note/delete/85449/non-english
Del: in docs -- https://master.php.net/note/delete/85449/in+docs
Del: other reasons-- https://master.php.net/note/delete/85449
Reject -- https://master.php.net/note/reject/85449
Search -- https://master.php.net/manage/user-notes.php