Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use constants instead of strings.

Using built-in constants where possible is generally a good idea,
making code less error prone.
  • Loading branch information...
commit 613aa19d945a508c2aaae6470fe90c87806445e5 1 parent fee6172
@markstory markstory authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/Cake/Utility/Security.php
View
6 lib/Cake/Utility/Security.php
@@ -199,7 +199,7 @@ public static function cipher($text, $key) {
* Encrypts/Decrypts a text using the given key using rijndael method.
*
* @param string $text Encrypted string to decrypt, normal string to encrypt
- * @param string $key Key to use
+ * @param string $key Key to use as the encryption key for encrypted data.
* @param string $operation Operation to perform, encrypt or decrypt
* @return string Encrypted/Descrypted string
*/
@@ -216,8 +216,8 @@ public static function rijndael($text, $key, $operation) {
trigger_error(__d('cake_dev', 'You must use a key larger than 32 bytes for Security::rijndael()'), E_USER_WARNING);
return '';
}
- $algorithm = 'rijndael-256';
- $mode = 'cbc';
+ $algorithm = MCRYPT_RIJNDAEL_256;
+ $mode = MCRYPT_MODE_CBC;
$cryptKey = substr($key, 0, 32);
$iv = substr($key, strlen($key) - 32, 32);
Please sign in to comment.
Something went wrong with that request. Please try again.