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

[11.x] Fix PHP_MAXPATHLEN check for existing check of files for views #50962

Merged
merged 3 commits into from
Apr 9, 2024

Commits on Apr 8, 2024

  1. Add test for \PHP_MAXPATHLEN errors

    A PHP warning can occur if the filename is a little less than (or equal to) \PHP_MAXPATHLEN [1] AND open_basedir [2] is configured (otherwise PHP will not throw this error [3]). By searching for the filename and appending a suffix (and also using the absolute path), we may exceed the limit. If the limit is exceeded, PHP throws a warning message [4] and Laravel aborts the execution of the code.
    
    [1] https://www.php.net/manual/en/reserved.constants.php#constant.php-maxpathlen
    [2] https://www.php.net/manual/en/ini.core.php#ini.open-basedir
    [3] https://github.com/php/php-src/blob/7c860628cd2bf11ee867bfb41b3fd0314c5177c5/main/fopen_wrappers.c#L302
    [4] File name is longer than the maximum allowed path length on this platform
    joshuaruesweg committed Apr 8, 2024
    Configuration menu
    Copy the full SHA
    ca8fa7e View commit details
    Browse the repository at this point in the history
  2. Fix PHP_MAXPATHLEN check for existing check of files for views

    A PHP warning can occur if the filename is a little less than (or equal to) \PHP_MAXPATHLEN [1] AND open_basedir [2] is configured (otherwise PHP will not throw this error [3]). By searching for the filename and appending a suffix (and also using the absolute path), we may exceed the limit. If the limit is exceeded, PHP throws a warning message [4] and Laravel aborts the execution of the code.
    
    [1] https://www.php.net/manual/en/reserved.constants.php#constant.php-maxpathlen
    [2] https://www.php.net/manual/en/ini.core.php#ini.open-basedir
    [3] https://github.com/php/php-src/blob/7c860628cd2bf11ee867bfb41b3fd0314c5177c5/main/fopen_wrappers.c#L302
    [4] File name is longer than the maximum allowed path length on this platform
    joshuaruesweg committed Apr 8, 2024
    Configuration menu
    Copy the full SHA
    50b8885 View commit details
    Browse the repository at this point in the history

Commits on Apr 9, 2024

  1. Configuration menu
    Copy the full SHA
    11572d5 View commit details
    Browse the repository at this point in the history