Skip to content

Commit

Permalink
Crypt base64 string fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tugrul committed Dec 21, 2016
1 parent a8a99bd commit cf4f3b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions phalcon/crypt.zep
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class Crypt implements CryptInterface
public function encryptBase64(string! text, key = null, boolean! safe = false) -> string
{
if safe == true {
return rtrim(strtr(base64_encode(this->encrypt(text, key)), "+/", "-_"), '=');
return rtrim(strtr(base64_encode(this->encrypt(text, key)), "+/", "-_"), "=");
}
return base64_encode(this->encrypt(text, key));
}
Expand All @@ -383,7 +383,7 @@ class Crypt implements CryptInterface
public function decryptBase64(string! text, key = null, boolean! safe = false) -> string
{
if safe == true {
return this->decrypt(base64_decode(strtr(text, "-_", "+/") . substr('===', (strlen(text) + 3) % 4)), key);
return this->decrypt(base64_decode(strtr(text, "-_", "+/") . substr("===", (strlen(text) + 3) % 4)), key);
}
return this->decrypt(base64_decode(text), key);
}
Expand Down

0 comments on commit cf4f3b8

Please sign in to comment.