Use the Joomla encrypt classes from fof
PHP 7.2 compatibility
[Fri Nov 23 11:59:07 2018] PHP Warning: Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128' (this will throw an Error in a future version of PHP) in /Users/phil/example.com/libraries/fof/encrypt/aes.php on line 170
[Fri Nov 23 11:59:07 2018] PHP Warning: Use of undefined constant MCRYPT_MODE_CBC - assumed 'MCRYPT_MODE_CBC' (this will throw an Error in a future version of PHP) in /Users/phil/example.com/libraries/fof/encrypt/aes.php on line 170
joomla-cms/libraries/fof/encrypt/aes.php
Line 170 in ddfa622
No errors
PHP 7.2 command line
@nikosdion states:
The latter two notices come from FOF 2 which is part of Joomla!. I terminated support for FOF 2 in mid-2016. FWIW the latest FOF 2 version I supplied to Joomla! does not have this problem. We are detecting mcrypt or OpenSSL presence and we prefer to use the latter.
Labels |
Added:
?
|
If you're doing blind searches for anything mcrypt related you're going to find a lot of references. The fact they exist is not a problem. If they are actually being used on PHP 7.2, it is a problem. If you look at the restore.php code you will find that class is conditionally instantiated therefore those lines you highlighted are only executed if that condition is true.
Also take into consideration that the extension is installable via PECL. Therefore, a straight up "mcrypt should not be executed on PHP 7.2" policy cannot apply to any code, you must continue to use extension_loaded()
checks.
Use the Joomla encrypt classes from fof
Simple solution don't use $adapter = new FOFEncryptAesMcrypt();
but $adapter = new FOFEncryptAesOpenssl();
:P
But this here:
joomla-cms/libraries/fof/encrypt/aes.php
Lines 34 to 69 in ddfa622
priority
?
So how can you reproduce the problem, without directly using $adapter = new FOFEncryptAesMcrypt();
?
So how can you reproduce the problem
This problem came to light when moving a Joomla site to localhost which is PHP 7.2, and on restoring the site using Akeeba ANGIE wizard 6.3.0.
This problem came to light when moving a Joomla site to localhost which is PHP 7.2, and on restoring the site using Akeeba ANGIE wizard 6.3.0.
Can you reproduce the problem on a clean install without 3rd Party Software on the same localhost running PHP 7.2?
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-11-23 15:26:15 |
Closed_By | ⇒ | PhilETaylor |
Can you reproduce the problem on a clean install without 3rd Party Software on the same localhost running PHP 7.2?
Nope. Case closed.
MCRYPT_RIJNDAEL_128 is also used in restore.php
joomla-cms/administrator/components/com_joomlaupdate/restore.php
Line 6916 in ddfa622
and MCRYPT_MODE_CBC
joomla-cms/administrator/components/com_joomlaupdate/restore.php
Line 6918 in ddfa622