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

Wrong usage of stream_isatty(), fstat() used without checking whether the function is available #59

Closed
jakubmisek opened this issue Apr 4, 2020 · 0 comments

Comments

@jakubmisek
Copy link

seems the line 94 makes use of stream_isatty which will always return false (because of the condition at 89). Also, it lacks check if the function exists causes a fatal error on PHP's without the stream support.

if (\function_exists('stream_isatty') && @\stream_isatty($fileDescriptor)) {
return true;
}
// Check if formatted mode is S_IFCHR
if (\function_exists('fstat') && @\stream_isatty($fileDescriptor)) {
$stat = @\fstat(\STDOUT);

@sebastianbergmann sebastianbergmann changed the title use of stream_isatty() seems as a typo Wrong usage of stream_isatty(), fstat() used without checking whether the function is available Apr 14, 2022
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

1 participant