chore: Проверки к типам
This commit is contained in:
parent
8786e84568
commit
18cc1cad01
8 changed files with 34 additions and 28 deletions
|
|
@ -106,7 +106,11 @@ class TemplateImage
|
|||
{
|
||||
$suffix = pathinfo($file, PATHINFO_EXTENSION);
|
||||
if (array_key_exists($suffix, self::$listfiles)) {
|
||||
return call_user_func('imagecreatefrom' . self::$listfiles[$suffix], $file);
|
||||
$imageFn = 'imagecreatefrom' . self::$listfiles[$suffix];
|
||||
if (!is_callable($imageFn)) {
|
||||
return null;
|
||||
}
|
||||
return call_user_func($imageFn, $file);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue