Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 7.2 Compat - mcrypt_decrypt() is REMOVED #144

Open
rogertheriault opened this issue Mar 29, 2018 · 1 comment · Fixed by #159
Open

PHP 7.2 Compat - mcrypt_decrypt() is REMOVED #144

rogertheriault opened this issue Mar 29, 2018 · 1 comment · Fixed by #159

Comments

@rogertheriault
Copy link

mcrypt_decrypt() (and similar functions) is removed in 7.2, deprecated in 7.1

Result: the Add Site page breaks on PHP 7.2

image

Fatal error: Uncaught Error: Call to undefined function mcrypt_decrypt() in (stack trace...) 
plugins/syndication/includes/push-syndicate-encryption.php on line 12

(It may also cause folks to go looking for the module)

When opening the Add Site interface, with PHP 7.1 a deprecation warning is issued:

image

@WPprodigy
Copy link

WPprodigy commented Sep 5, 2018

This would be good to get patched, as it causes fatals on all non-VIP sites running up to date versions of PHP.

The only uses of these two functions can be found here: https://github.com/Automattic/syndication/blob/374adf60d73afc739dd6fb406243a80ebf54a8db/includes/push-syndicate-encryption.php. These functions are seemingly only used for encrypting the syndicated site password & syndicated site token before saving to post meta, and then decrypting before displaying in settings and being used in API calls.

Possible Solutions:

Use the openssl_* library if available:

Use the defuse/php-encryption library:


Workarounds

In the mean time, I suppose the available workarounds are:

  • Add the ext/mcrypt PECL package to your PHP build.
  • Use PHP 7.1 rather than 7.2.
  • Per the above section, replace the two uses of mcrypt_* with openssl_*.

@vaurdan vaurdan linked a pull request Jul 5, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants