模板缩略图支持识别webp图片后缀 (#1403)

* 模板缩略图支持识别webp图片后缀

* Update Contents.php

Co-authored-by: 沈唁 <52o@qq52o.cn>
This commit is contained in:
jrotty
2022-04-15 13:51:06 +08:00
committed by GitHub
parent 9fd02529b1
commit 0fbb1aaea5
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -554,7 +554,7 @@ class Contents extends Base implements QueryInterface
//增加数据信息
$value['attachment'] = new Config($content);
$value['attachment']->isImage = in_array($content['type'], ['jpg', 'jpeg', 'gif', 'png', 'tiff', 'bmp']);
$value['attachment']->isImage = in_array($content['type'], ['jpg', 'jpeg', 'gif', 'png', 'tiff', 'bmp', 'webp']);
$value['attachment']->url = Upload::attachmentHandle($value);
if ($value['attachment']->isImage) {
+1 -1
View File
@@ -45,7 +45,7 @@ class Rows extends Widget
}
$screen = array_filter(glob($theme . '/*'), function ($path) {
return preg_match("/screenshot\.(jpg|png|gif|bmp|jpeg)$/i", $path);
return preg_match("/screenshot\.(jpg|png|gif|bmp|jpeg|webp)$/i", $path);
});
if ($screen) {