Sterc / FormIt

A dynamic form processing Snippet for MODX Revolution
https://docs.modx.com/current/en/extras/formit
33 stars 58 forks source link

Replace mcrypt functions for php 7.2 compatibility #115

Closed joeke closed 7 years ago

joeke commented 7 years ago

The mcrypt functions are to be removed from core PHP in version 7.2. Replace the mcrypt_encrypt and mcrypt_decrypt functions with openssl_encrypt and openssl_decrypt. There should be a migration script that converts currently encrypted data to the new method, which should run on package update.

joeke commented 7 years ago

Fixed with version 3.0.0

Mark-H commented 2 years ago

FWIW, I'm just running php compatibility checker and am still seeing mcrypt in use in the RecaptchaService class (4.2.6):

FILE: /home/Sites/development/3.x/core/packages/formit-4.2.6-pl/modCategory/ed54f2aeac05d6da1b149f1ef3acc65c/1/formit/src/FormIt/Service/RecaptchaService.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 3 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 208 | ERROR | The constant "MCRYPT_MODE_CBC" is deprecated since PHP 7.1 and removed since PHP 7.2 (PHPCompatibility.Constants.RemovedConstants.mcrypt_mode_cbcDeprecatedRemoved)
 209 | ERROR | The constant "MCRYPT_RIJNDAEL_128" is deprecated since PHP 7.1 and removed since PHP 7.2 (PHPCompatibility.Constants.RemovedConstants.mcrypt_rijndael_128DeprecatedRemoved)
 211 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
     |       | (PHPCompatibility.Extensions.RemovedExtensions.mcryptDeprecatedRemoved)
 211 | ERROR | Function mcrypt_encrypt() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead (PHPCompatibility.FunctionUse.RemovedFunctions.mcrypt_encryptDeprecatedRemoved)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------