Browse Source

refactoring the crypter class.

Taylor Otwell 13 years ago
parent
commit
8d3151b134
1 changed files with 2 additions and 8 deletions
  1. 2 8
      laravel/security/crypter.php

+ 2 - 8
laravel/security/crypter.php

@@ -55,16 +55,10 @@ class Crypter {
 	 */
 	protected static function randomizer()
 	{
-		if (defined('MCRYPT_DEV_URANDOM'))
+		foreach (array('MCRYPT_DEV_URANDOM', 'MCRYPT_DEV_RANDOM', 'MCRYPT_RAND') as $generator)
 		{
-			return MCRYPT_DEV_URANDOM;
+			if (defined($generator)) return constant($generator);
 		}
-		elseif (defined('MCRYPT_DEV_RANDOM'))
-		{
-			return MCRYPT_DEV_RANDOM;
-		}
-
-		return MCRYPT_RAND;			
 	}
 
 	/**