mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Use constants instead of strings.
Using built-in constants where possible is generally a good idea, making code less error prone.
This commit is contained in:
parent
fee6172958
commit
613aa19d94
1 changed files with 3 additions and 3 deletions
|
@ -199,7 +199,7 @@ class Security {
|
|||
* 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 @@ class Security {
|
|||
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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue