mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
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:
parent
72d90f2ce8
commit
d41a28c975
2 changed files with 9 additions and 1 deletions
|
@ -323,7 +323,7 @@ class SecurityComponent extends Object {
|
||||||
|
|
||||||
if (strtolower($options['type']) == 'digest') {
|
if (strtolower($options['type']) == 'digest') {
|
||||||
$out[] = 'qop="auth"';
|
$out[] = 'qop="auth"';
|
||||||
$out[] = 'nonce="' . uniqid() . '"';
|
$out[] = 'nonce="' . uniqid("") . '"';
|
||||||
$out[] = 'opaque="' . md5($options['realm']).'"';
|
$out[] = 'opaque="' . md5($options['realm']).'"';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -363,6 +363,14 @@ class SecurityComponentTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testDigestAuth() {
|
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';
|
$this->Controller->action = 'posted';
|
||||||
$_SERVER['PHP_AUTH_DIGEST'] = $digest = <<<DIGEST
|
$_SERVER['PHP_AUTH_DIGEST'] = $digest = <<<DIGEST
|
||||||
Digest username="Mufasa",
|
Digest username="Mufasa",
|
||||||
|
|
Loading…
Add table
Reference in a new issue