模板缩略图支持识别webp图片后缀 (#1403)
* 模板缩略图支持识别webp图片后缀 * Update Contents.php Co-authored-by: 沈唁 <52o@qq52o.cn>
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user