From 0fbb1aaea558403e1a97012ad7cec3bc3ee021c6 Mon Sep 17 00:00:00 2001 From: jrotty Date: Fri, 15 Apr 2022 13:51:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E7=BC=A9=E7=95=A5=E5=9B=BE?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=AF=86=E5=88=ABwebp=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=90=8E=E7=BC=80=20(#1403)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 模板缩略图支持识别webp图片后缀 * Update Contents.php Co-authored-by: 沈唁 <52o@qq52o.cn> --- var/Widget/Base/Contents.php | 2 +- var/Widget/Themes/Rows.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/var/Widget/Base/Contents.php b/var/Widget/Base/Contents.php index 43b40501..184827aa 100644 --- a/var/Widget/Base/Contents.php +++ b/var/Widget/Base/Contents.php @@ -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) { diff --git a/var/Widget/Themes/Rows.php b/var/Widget/Themes/Rows.php index 5a5b1ef3..5fdbdf82 100644 --- a/var/Widget/Themes/Rows.php +++ b/var/Widget/Themes/Rows.php @@ -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) {