password_compat icon indicating copy to clipboard operation
password_compat copied to clipboard

php7 Compatibility problem

Open oasfuyou opened this issue 7 years ago • 5 comments

105 | ERROR | Function mcrypt_create_iv() is deprecated since PHP 7.1 and removed since PHP 7.2; Use random_bytes() or OpenSSL instead 105 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead 105 | ERROR | The constant "MCRYPT_DEV_URANDOM" is deprecated since PHP 7.1 and removed since PHP 7.2

oasfuyou avatar Aug 24 '18 06:08 oasfuyou

This library shouldn't be used on any PHP version equal to 5.5 or higher. You should be able to use the native password_* functions.

bpearson avatar Aug 24 '18 08:08 bpearson

Hi: but other package depends this package,so how to improve to php7

------------------ Original ------------------ From: "Benjamin Pearson"[email protected]; Date: Fri, Aug 24, 2018 04:36 PM To: "ircmaxell/password_compat"[email protected]; Cc: "付友"[email protected]; "Author"[email protected]; Subject: Re: [ircmaxell/password_compat] php7 Compatibility problem (#106)

This library shouldn't be used on any PHP version equal to 5.5 or higher

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

oasfuyou avatar Aug 24 '18 08:08 oasfuyou

That part of the code will never be executed on PHP 7 as the password_hash() function does exist there: https://github.com/ircmaxell/password_compat/blob/master/lib/password.php#L24

xabbuh avatar Aug 24 '18 08:08 xabbuh

...and if your code analyser is still complaining, it's a bug in your code analyser, not this lib.

Synchro avatar Aug 24 '18 14:08 Synchro

@oasfuyou These errors can be safely ignored (as long as they come from this package).

All the same, this is something which we could sort out in the new PHPCompatibilityPasswordCompat repo. Would you mind opening an issue about it in that repo ?

jrfnl avatar Oct 07 '18 22:10 jrfnl