includes/rijndael.php
changeset 58 8f532d8ab5f5
parent 54 84b56303cab5
child 286 b2f985e4cef3
--- a/includes/rijndael.php	Fri Jul 06 11:45:50 2007 -0400
+++ b/includes/rijndael.php	Tue Jul 10 00:40:52 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);