Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[11.x] Fix PHP_MAXPATHLEN check for strings slightly smaller then PHP…
…_MAXPATHLEN (#51850) * Fix `PHP_MAXPATHLEN` test This test was incorrect because it does not take into account the paths that are prefixed in the FileViewFinder. This means that we have so far tested a path that is significantly longer than `PHP_MAXPATHLEN`. As we cannot reliably access the path, we approach `PHP_MAXPATHLEN` and test all file names from `PHP_MAXPATHLEN - 200` to `PHP_MAXPATHLEN + 1`. * Fix `PHP_MAXPATHLEN` check The previous test was wrong. In fact, `PHP_MAXPATHLEN` is not the maximum length of a file, but `PHP_MAXPATHLEN - 1`. This is checked internally in the PHP source code and if the file is PHP_MAXPATHLEN characters long or longer, the error is thrown in Open-Base-Dir [1]. The problem was incompletely fixed here: #50962 [1] https://github.com/php/php-src/blob/7c860628cd2bf11ee867bfb41b3fd0314c5177c5/main/fopen_wrappers.c#L301
- Loading branch information