includes/rijndael.php
changeset 54 84b56303cab5
parent 45 9cb99e37bfc4
child 229 b2f985e4cef3
--- a/includes/rijndael.php	Sat Jul 07 22:54:20 2007 -0400
+++ b/includes/rijndael.php	Sat Jul 07 23:06:28 2007 -0400
@@ -744,6 +744,8 @@
    
   function encrypt($text, $key, $return_encoding = ENC_HEX)
   {
+    if ( $text == '' )
+      return '';
     if ( $this->mcrypt && $this->blockSizeInBits == mcrypt_module_get_algo_block_size(eval('return MCRYPT_RIJNDAEL_'.$this->keySizeInBits.';')) )
     {
       $iv_size = mcrypt_get_iv_size($this->mcrypt, MCRYPT_MODE_ECB);
@@ -800,6 +802,8 @@
    
   function decrypt($text, $key, $input_encoding = ENC_HEX)
   {
+    if ( $text == '' )
+      return '';
     switch($input_encoding)
     {
       case ENC_BINARY:
@@ -997,7 +1001,8 @@
   }
    
   function encrypt($str, $key) {
-      if ($str == "") {
+      if ($str == "")
+      {
           return "";
       }
       $v = $this->str2long($str, true);