-
Notifications
You must be signed in to change notification settings - Fork 3
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 Deprecated Function: mcrypt_list_algorithms() #340
Comments
I've worked with Defuse recently and there is an example here if it helps. |
The trickiest part about Defuse is that it requires a Defuse-generated key that needs to be stored in the WP database once it is generated for a site; i.e., you can't just use any random string or |
Generating the key. use Defuse\Crypto\Key;
$key = Key::createNewRandomKey()->saveToAsciiSafeString(); Saving it in the DB. update_option('defuse_key', $key); Reading, unpacking the key. $key = Key::loadFromAsciiSafeString(get_option('defuse_key')); Using the key. use Defuse\Crypto\Key;
use Defuse\Crypto\Crypto;
$key = Key::loadFromAsciiSafeString(get_option('defuse_key'));
$encrypted = Crypto::encrypt('something secret', $key, false);
$decrypted = Crypto::decrypt($encrypted, $key, false); |
When testing with WordPress v4.8 and Comment Mail Lite/ Pro an error prompt occurs only when
WP_DEBUG
was enabled for both Comment Mail Lite/Pro versions. When clicking the confirmation link from the Confirmation Subscription Email, you are redirected to a page with -Deprecated: Function mcrypt_list_algorithms():
Comment Mail Lite Version 161213 Test || with WP_DEBUG enabled
Results with WP_DEBUG enabled
Error Prompt
-- When Confirming SubscriptionDeprecated: Function mcrypt_list_algorithms()
Email Confirmation Link
Error Prompt after clicking Link
Comment Mail Pro Version 161213 Test || with WP_DEBUG enabled
Results with WP_DEBUG enabled
Error Prompt
-- When Confirming SubscriptionDeprecated: Function mcrypt_list_algorithms():
Email Confirmation Link
Error Prompt after clicking Link
These lines in the source code are where this function is used:
here and here
The text was updated successfully, but these errors were encountered: