فهرست منبع

fixed function_exist test and used newer mcrypt functions. If squirrelmail
minimal requirements are 4.1.2, function test can be removed.

tokul 21 سال پیش
والد
کامیت
9d08586fc4
1فایلهای تغییر یافته به همراه9 افزوده شده و 2 حذف شده
  1. 9 2
      plugins/squirrelspell/sqspell_functions.php

+ 9 - 2
plugins/squirrelspell/sqspell_functions.php

@@ -151,7 +151,7 @@ function sqspell_crypto($mode, $ckey, $input){
    * Double-check if we have the mcrypt_generic function. Bail out if
    * not so.
    */
-  if (!function_exists(mcrypt_generic)) {
+  if (!function_exists('mcrypt_generic')) {
     return 'PANIC';
   }
   /**
@@ -183,7 +183,14 @@ function sqspell_crypto($mode, $ckey, $input){
   /**
    * Finish up the mcrypt routines and return the processed content.
    */
-  mcrypt_generic_end ($td);
+  if (function_exists('mcrypt_generic_deinit')) {
+      // php 4.1.1+ syntax
+      mcrypt_generic_deinit ($td);
+      mcrypt_module_close ($td);
+  } else {
+      // older depreciated function
+      mcrypt_generic_end ($td);
+  }
   return $crypto;
 }