Merge pull request #14227 from civicrm/5.14
[civicrm-core.git] / CRM / Utils / Crypt.php
index e914eaa9ce7d5e36fe49d06224a9966be59e8871..cfd7b09b9a9f6b85f6adc4bde4d575b4eea9fcd8 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018                                |
+ | Copyright CiviCRM LLC (c) 2004-2019                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC (c) 2004-2019
  */
 class CRM_Utils_Crypt {
 
@@ -55,6 +55,7 @@ class CRM_Utils_Crypt {
     if (function_exists('mcrypt_module_open') &&
       defined('CIVICRM_SITE_KEY')
     ) {
+      // phpcs:disable
       $td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_ECB, '');
       // ECB mode - iv not needed - CRM-8198
       $iv = '00000000000000000000000000000000';
@@ -66,6 +67,7 @@ class CRM_Utils_Crypt {
       mcrypt_generic_deinit($td);
       mcrypt_module_close($td);
     }
+    // phpcs:enable
     return base64_encode($string);
   }
 
@@ -94,6 +96,7 @@ class CRM_Utils_Crypt {
     if (function_exists('mcrypt_module_open') &&
       defined('CIVICRM_SITE_KEY')
     ) {
+      // phpcs:disable
       $td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_ECB, '');
       // ECB mode - iv not needed - CRM-8198
       $iv = '00000000000000000000000000000000';
@@ -104,6 +107,7 @@ class CRM_Utils_Crypt {
       $string = rtrim(mdecrypt_generic($td, $string));
       mcrypt_generic_deinit($td);
       mcrypt_module_close($td);
+      // phpcs:enable
     }
 
     return $string;