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:
@@ -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';
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user