From 64739858014b632013fc38ccdc882aad12b655a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=AA=E5=AD=90?= Date: Thu, 6 Jun 2024 08:17:57 +0800 Subject: [PATCH] Update functions.php --- functions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index d5d0413..b633d78 100644 --- a/functions.php +++ b/functions.php @@ -174,11 +174,12 @@ function allwords() { function show_first_image($content) { preg_match_all('//i', $content, $matches); // 检查是否找到了图片 - if(isset($matches[1][0])){ + if(count($matches) > 0 && count($matches[0]) > 0 ){ return $matches[1][0]; - } + } else { return false; // 没有找到图片,返回 false } +} //开始增加某些奇怪的东西 // 获取月份 function getMonth() {