diff --git a/php/encrypt-decrypt.php b/php/encrypt-decrypt.php index d333303..5f6d19e 100755 --- a/php/encrypt-decrypt.php +++ b/php/encrypt-decrypt.php @@ -9,7 +9,7 @@ function encrypt($str, $salt=null) { $out .= chr(ord($str{$i})+ord($kc)); } $out = base64_encode($out); - $out = str_replace(array('=', '/'), array('', '-'), $out); + $out = str_replace(array('/', '='), array('-', ''), $out); return $out; } @@ -17,7 +17,7 @@ function encrypt($str, $salt=null) { function decrypt($str, $salt=null) { $salt = md5($salt); $out = ''; - $str = str_replace('-', '/', $str); + $str = str_replace(array('-', ' ', '%20'), array('/', '+', '+'), $str); $str = base64_decode($str); for ($i = 0; $i \ No newline at end of file +?>