The Wayback Machine - https://web.archive.org/web/20200916003812/https://github.com/php-gettext/Gettext/pull/254
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
from
Open

Update Scanner.php #254

wants to merge 1 commit into from

Conversation

@vinodraut
Copy link

vinodraut commented Apr 9, 2020

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 left a comment

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

vinodraut commented Apr 10, 2020

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

oscarotero commented Apr 10, 2020

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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.