mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Reverting change to Security::cipher(); in [7322]. Newer versions of PHP 5.2.1 and above no longer produce same identical seeds
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7324 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
ed0a031ec4
commit
3713fe25ae
1 changed files with 3 additions and 3 deletions
|
@ -183,14 +183,14 @@ class Security extends Object {
|
|||
//This is temporary will change later
|
||||
define('CIPHER_SEED', '76859309657453542496749683645');
|
||||
}
|
||||
mt_srand(CIPHER_SEED);
|
||||
srand(CIPHER_SEED);
|
||||
$out = '';
|
||||
|
||||
for ($i = 0; $i < strlen($text); $i++) {
|
||||
for ($j = 0; $j < ord(substr($key, $i % strlen($key), 1)); $j++) {
|
||||
$toss = mt_rand(0, 255);
|
||||
$toss = rand(0, 255);
|
||||
}
|
||||
$mask = mt_rand(0, 255);
|
||||
$mask = rand(0, 255);
|
||||
$out .= chr(ord(substr($text, $i, 1)) ^ $mask);
|
||||
}
|
||||
return $out;
|
||||
|
|
Loading…
Add table
Reference in a new issue