1
0
mirror of https://github.com/Intervention/image.git synced 2025-09-01 18:02:45 +02:00

Merge pull request #1255 from Intervention/bugfix/maximum-path-length

Fix bug with very long file/path names
This commit is contained in:
Oliver Vogel
2024-01-14 08:46:31 +01:00
committed by GitHub
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');