Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit d41a28c975a4bad5f52dddef3f67796084e3b2b5 1 parent 72d90f2
@jperras jperras authored
View
2  cake/libs/controller/components/security.php
@@ -323,7 +323,7 @@ function loginRequest($options = array()) {
if (strtolower($options['type']) == 'digest') {
$out[] = 'qop="auth"';
- $out[] = 'nonce="' . uniqid() . '"';
+ $out[] = 'nonce="' . uniqid("") . '"';
$out[] = 'opaque="' . md5($options['realm']).'"';
}
View
8 cake/tests/cases/libs/controller/components/security.test.php
@@ -363,6 +363,14 @@ function testRequireLogin() {
* @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",
Please sign in to comment.
Something went wrong with that request. Please try again.