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

Cannot redeclare random_int() #125

Closed
Shrimpstronaut opened this issue Mar 3, 2017 · 1 comment
Closed

Cannot redeclare random_int() #125

Shrimpstronaut opened this issue Mar 3, 2017 · 1 comment

Comments

@Shrimpstronaut
Copy link

Hey there,

we have just stumbled upon a critical problem. We are using defuse/php-encryption in one of our projects. defuse/php-encryption uses random_compat.

When deploying our project, we receive the following error:


PHP error in: xxx/tags/2.0.13/vendor/paragonie/random_compat/lib/random_int.php:

Fatal error: Cannot redeclare random_int() in xxx/tags/2.0.13/vendor/paragonie/random_compat/lib/random_int.php on line 186
Errors parsing xxx/tags/2.0.13/vendor/paragonie/random_compat/lib/random_int.php

I have already found the following issue #115 which seems to be talking about a similar problem.

random_int.php does not have an is_callable() check like random_bytes_mcrypt.php.

@paragonie-scott
Copy link
Member

This is what happens when people include any file except lib/random.php, against our recommendation. The usual fix is "don't do that, use random.php instead", but in this case I think the culprit is box.json.

13004a7?w=1 will fix it. I'll get a new release out ASAP, and will bug @defuse to see if he needs to release a new .phar.

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

2 participants