note 85449 deleted from features.http-auth by felipe
| From: | felipe@php.net | Date: | Tue, 02 Sep 2008 11:21:10 +0000 |
| Subject: | note 85449 deleted from features.http-auth by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-144072@lists.php.net to get a copy of this message | ||
Note Submitter: fakeraol at hotmail dot com
----
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.