-
Notifications
You must be signed in to change notification settings - Fork 291
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
file_exists() throws exception when a NULL character exists in string #412
Comments
What php version are you on to get this? 8.2 and the git master both have no problem with strings with nuls in them According to the
But there's no type hint for "Path" strings nor is that actually used by PHP Are you overriding file_exists with something? |
The server is running php 7.4 and working inside the Codeigniter MVC framework. I'll dig around and see if the framework overrides it, but it seems to be using the root namespace. |
Apparently Prior to 8.0 error suppression normally prevents any warning from being emitted but you can use Now the parser has an exception catch around plugins to prevent plugins from crashing execution, but this only handles Unfortunately all this probably has nothing to do with this error since codeigniter turns errors into I wasn't able to find anything related to Ultimately changing it to catch throwables instead of exceptions might fix this issue, but then kint produces a warning and (Especially in debug mode) your framework might decide to kill everything then anyway. So long story short I still don't know what causes this specific bug a year later, but we know it doesn't happen on PHP 8 at least... It may be some third party library is messing with the error handlers, if you're still interested in looking at this bug try |
Well I'm an idiot. The undocumented error becomes a Apparently strict types ignores error suppression and I didn't have a test case for this. I'll be going through and checking this with all suppressed errors now |
In FsPathPlugin, in the parse() method, when a null byte exists in the passed in parameter, file_exists throws an exception. If you replace NULL characters the exception is prevented
The text was updated successfully, but these errors were encountered: