1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-30 01:00:06 +02:00

Simplify GIF magic number detection (#1446)

Removed unnecessary bin2hex() conversion.
This commit is contained in:
vlakoff
2025-05-27 07:58:35 +02:00
committed by GitHub
parent f98f4d8aae
commit 88466c6a49

View File

@@ -24,10 +24,7 @@ abstract class AbstractDecoder implements DecoderInterface
{
$head = substr($input, 0, 6);
return 1 === preg_match(
"/^47494638(37|39)61/",
strtoupper(bin2hex($head))
);
return $head === 'GIF87a' || $head === 'GIF89a';
}
/**