TypeRocket / core

TypeRocket core source files where all the magic lives.
https://typerocket.com
36 stars 21 forks source link

PHP Warning: file_exists(): File name is longer than the maximum allowed path length on this platform (4096) #98

Closed pewu-dev closed 3 years ago

pewu-dev commented 3 years ago

Hi,

In some cases, issued this condition may trigger the warning mentioned in the title: https://github.com/TypeRocket/core/blob/f1f9b95c06dbd9afce6912b167a2a0494a598567/src/Register/Page.php#L515

I suggest to add a check of max allowed file path length to avoid this warning. elseif( strlen( $response ) <= PHP_MAXPATHLEN && file_exists($response) ) {

kevindees commented 3 years ago

Hey @pewu-dev

I'm not sure about the value of suppressing the error. Will this lead to confusion for debugging?

Thanks, Kevin

pewu-dev commented 3 years ago

Sorry, i don't understand. You mean what value causes this warning? I met this when i return html content directly in controller (not as typerocket view), and this string is longer than allowed path length.

kevindees commented 3 years ago

Hey @pewu-dev

Fix for this will go live soon.