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

php7 Deprecated warning for mcrypt_create_iv on \OAuth2\ResponseType\AccessToken::generateAccessToken() #772

Open
zzwang opened this issue Oct 14, 2016 · 2 comments

Comments

@zzwang
Copy link

zzwang commented Oct 14, 2016

In PHP7, mcryot_create_iv() is deprecated.
Due to https://github.com/bshaffer/oauth2-server-php/pull/368/files, using mcrypt_create_iv as the default method to generate random bytes causes a deprecated warning.

        if (function_exists('mcrypt_create_iv')) {
            $randomData = mcrypt_create_iv(20, MCRYPT_DEV_URANDOM);
            if ($randomData !== false && strlen($randomData) === 20) {
                return bin2hex($randomData);
            }
        }

Should we just remove that block or just add version_compare like

        if (function_exists('mcrypt_create_iv') && version_compare(7, phpversion()) == 1) {
            $randomData = mcrypt_create_iv(20, MCRYPT_DEV_URANDOM);
            if ($randomData !== false && strlen($randomData) === 20) {
                return bin2hex($randomData);
            }
        }
@pjcdawkins
Copy link

Looks like this would be resolved by #773

@mathroc
Copy link
Contributor

mathroc commented Mar 7, 2017

and it's been released so this issue might be closed ( #788 )

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

No branches or pull requests

3 participants