-
Notifications
You must be signed in to change notification settings - Fork 88
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
mcrypt_get_iv_size() is deprecated in PHP 7.1 #186
Comments
Hello, thanks for pointing this out! The problem is HashOver uses Mcrypt, which has been deprecated in PHP 7.1. You can workaround this for now by using PHP 5.x, if that is an option. Regardless, a fix will be posted soon, hang tight... |
I have the same issue as the op in localhost using xampp and Windows 7. PHP 7.1.1 The console gives the message: And PHP response: Is there any other way around this issue until the library is updated. I've tried suppressing the error but it's still not displaying the comments. Using PHP 5.x is not an option for me, unfortunately. |
I couldn't wait so I've answered my own issue and changed the code to use openssl in the place of the deprecated mcrypt and the comments are now displaying when using PHP 7.1 If you have the same problem then here's the updated code: Go to encryption.php and change the Encryption class to the below code note: This code uses the
The code is written in a way that slots straight into the existing code so there's no need to change anything else. Edit: Made slight change to encrypt and decypt functions, setting returned Edit 2: base64 encoded iv and tag variables so the encrypted xml in the pages folder don't have any invalid characters. Without doing this you get an error when logged in and you provided an email address which prevents your comments from displaying and instead showing 'Something went wrong. Could not retrieve this comment. '. |
@leem32, can you create a pull request? |
Please note the following error in PHP 7.1:
PHP Deprecated: Function mcrypt_get_iv_size() is deprecated in /hashover/scripts/encryption.php on line 44.
It's probably a good idea to remove the mcrypt dependancy, since it will be removed in PHP 7.2 (and is already deprecated in PHP 7.1).
http://php.net/manual/en/function.mcrypt-get-iv-size.php
Use OpenSSL instead:
http://php.net/manual/en/function.openssl-encrypt.php
The text was updated successfully, but these errors were encountered: