Skip to content
This repository
Browse code

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
Joel Perras authored August 03, 2009
2  cake/libs/controller/components/security.php
@@ -323,7 +323,7 @@ function loginRequest($options = array()) {
323 323
 
324 324
 		if (strtolower($options['type']) == 'digest') {
325 325
 			$out[] = 'qop="auth"';
326  
-			$out[] = 'nonce="' . uniqid() . '"';
  326
+			$out[] = 'nonce="' . uniqid("") . '"';
327 327
 			$out[] = 'opaque="' . md5($options['realm']).'"';
328 328
 		}
329 329
 
8  cake/tests/cases/libs/controller/components/security.test.php
@@ -363,6 +363,14 @@ function testRequireLogin() {
363 363
  * @return void
364 364
  */
365 365
 	function testDigestAuth() {
  366
+		$skip = $this->skipIf((version_compare(PHP_VERSION, '5.1') == -1) XOR (!function_exists('apache_request_headers')),
  367
+			"%s Cannot run Digest Auth test for PHP versions < 5.1"
  368
+		);
  369
+
  370
+		if ($skip) {
  371
+			return;
  372
+		}
  373
+
366 374
 		$this->Controller->action = 'posted';
367 375
 		$_SERVER['PHP_AUTH_DIGEST'] = $digest = <<<DIGEST
368 376
 		Digest username="Mufasa",

0 notes on commit d41a28c

Please sign in to comment.
Something went wrong with that request. Please try again.