Fixing PHP4 compatibility issues for SecurityComponent.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8282 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
jperras 2009-08-03 19:40:02 +00:00
parent 72d90f2ce8
commit d41a28c975
2 changed files with 9 additions and 1 deletions

View file

@ -323,7 +323,7 @@ class SecurityComponent extends Object {
if (strtolower($options['type']) == 'digest') {
$out[] = 'qop="auth"';
$out[] = 'nonce="' . uniqid() . '"';
$out[] = 'nonce="' . uniqid("") . '"';
$out[] = 'opaque="' . md5($options['realm']).'"';
}

View file

@ -363,6 +363,14 @@ class SecurityComponentTest extends CakeTestCase {
* @return void
*/
function testDigestAuth() {
$skip = $this->skipIf((version_compare(PHP_VERSION, '5.1') == -1) XOR (!function_exists('apache_request_headers')),
"%s Cannot run Digest Auth test for PHP versions < 5.1"
);
if ($skip) {
return;
}
$this->Controller->action = 'posted';
$_SERVER['PHP_AUTH_DIGEST'] = $digest = <<<DIGEST
Digest username="Mufasa",