1
0
mirror of https://github.com/Intervention/image.git synced 2025-07-31 11:00:12 +02:00
PHP enconters problems on some machines when is_file() in
FilePathImageDecoders receive values that are longer than the
maximum-path-length of the host.

This fix checks if the input is in this maximum path length.
This commit is contained in:
Oliver Vogel
2024-01-08 16:40:01 +01:00
parent f8c6f315a2
commit c9903717ab
2 changed files with 11 additions and 3 deletions

View File

@@ -16,6 +16,10 @@ class FilePathImageDecoder extends BinaryImageDecoder implements DecoderInterfac
throw new DecoderException('Unable to decode input');
}
if (strlen($input) > PHP_MAXPATHLEN) {
throw new DecoderException('Unable to decode input');
}
try {
if (!@is_file($input)) {
throw new DecoderException('Unable to decode input');

View File

@@ -16,6 +16,10 @@ class FilePathImageDecoder extends BinaryImageDecoder implements DecoderInterfac
throw new DecoderException('Unable to decode input');
}
if (strlen($input) > PHP_MAXPATHLEN) {
throw new DecoderException('Unable to decode input');
}
try {
if (!@is_file($input)) {
throw new DecoderException('Unable to decode input');