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

Update Scanner.php #254

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

vinodraut
Copy link

handled generated notice on php 7.4 if its not file by by insuring it should be file, which further generate fatal error as fread returns false.

handled generated notice on php 7.4 if its not file by by insuring it should be file
Copy link
Member

@oscarotero oscarotero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution but I think that if the value is not a file, it should throw an Exception, as it does in line 89.

@vinodraut
Copy link
Author

Thanks for your contribution but I think that if the value is not a file, it should throw an Exception, as it does in line 89.

You are right, but I have weird experience on PHP 7.4.3+ where some items creates a problem with error 21 and further execution gets stop. But with same Glob to work on same code it works fine on below 7.4.3.

As this function is to read the files, I think we should do it as precautionary so there should not break the functionality.

Thank you

@oscarotero
Copy link
Member

What is the line that generates the code? filesize or fopen ?

If it's filesize maybe we can change this code to something more modern, without need to use filesize:

$content = stream_get_contents($fd);

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

Successfully merging this pull request may close these issues.

2 participants