From 52939fcbb44cf05e31edc06f6bda7fa0c24eac99 Mon Sep 17 00:00:00 2001 From: justin-jiajia Date: Sat, 1 Aug 2026 20:42:04 +0800 Subject: [PATCH] Correct the thumb url matching expression --- functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index 7ca7dcf..345946e 100644 --- a/functions.php +++ b/functions.php @@ -131,7 +131,7 @@ function themeInit($archive){ } function showThumb($obj,$size=null,$link=false){ - preg_match_all( "/<[img|IMG].*?src=[\'|\"](.*?)[\'|\"].*?[\/]?>/", $obj->content, $matches ); + preg_match_all( '/]*src=["\']([^"\']*)["\'][^>]*>/i', $obj->content, $matches ); $thumb = ''; $options = Typecho_Widget::widget('Widget_Options'); $attach = $obj->attachments(1)->attachment; @@ -325,4 +325,4 @@ function compressHtml($html_source) { $compress .= $c; } return $compress; -} \ No newline at end of file +}