Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phalcon\Crypt\decryptBase64() modifies its argument #1919

Closed
ghost opened this issue Jan 26, 2014 · 0 comments
Closed

Phalcon\Crypt\decryptBase64() modifies its argument #1919

ghost opened this issue Jan 26, 2014 · 0 comments

Comments

@ghost
Copy link

ghost commented Jan 26, 2014

Test case:

<?php
$crypt   = new \Phalcon\Crypt();
$source  = 'Life is much too short to be intoxicated';
$key     = 'very secret key';

do {
        $dest = $crypt->encryptBase64($source, $key, true);
} while (false === strpos($dest, '-'));
$copy    = (string)$dest;
$crypt->decryptBase64($dest, $key, true);
echo $dest, PHP_EOL;
echo $copy, PHP_EOL;
?>

Expected result: $dest === $cat
Sample actual result:

86j0nXjOaH7wJgpTa3zcsHVNu9KnvV6fGQsL2h/qTh5EzOPYapYJ6FZa2Hbo1ptG4W0pUV+PjlE4FYbSxgmszOFcZSUarKuCO/cAkySybEak+K+L0v7kDmJ/9bKXfF0b
86j0nXjOaH7wJgpTa3zcsHVNu9KnvV6fGQsL2h_qTh5EzOPYapYJ6FZa2Hbo1ptG4W0pUV-PjlE4FYbSxgmszOFcZSUarKuCO_cAkySybEak-K-L0v7kDmJ_9bKXfF0b

- is replaced with +; but because $source is not a reference it must not be modified.

@ghost ghost mentioned this issue Jan 26, 2014
phalcon pushed a commit that referenced this issue Jan 26, 2014
@ghost ghost closed this as completed Jan 27, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant