From 6b9cc81754b5b9f2efe7204932d07e1cc1fa802d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=AA=E5=AD=90?= Date: Tue, 8 Jul 2025 11:30:32 +0800 Subject: [PATCH] 1.1.7 --- README.MD | 10 ++++++++-- functions.php | 18 +++++++++++------- index.php | 2 +- sidebar.php | 2 +- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/README.MD b/README.MD index d811aa4..fb96d82 100644 --- a/README.MD +++ b/README.MD @@ -35,7 +35,13 @@ --- -### 2024-07-07 表情短代码解析集成 +- 2025.07.07 表情短代码解析集成 - 1.1.5 - - 将表情短代码(如 :smile:)自动解析为图片表情,集成到主题评论内容输出中。 \ No newline at end of file + - 将表情短代码(如 :smile:)自动解析为图片表情,集成到主题评论内容输出中。 + +- 2025.07.08 + - 1.1.6 + + - 修复头像区域背景的bug + - 优化php8.3兼容性 \ No newline at end of file diff --git a/functions.php b/functions.php index 27ce07b..7d09675 100644 --- a/functions.php +++ b/functions.php @@ -433,9 +433,11 @@ function getBrowsersInfo($userAgent) { "WebOS" => pregMatch("/^.*hpwOS\/([\d.]+);.*$/", $userAgent) ]; - if ($systemVersion[$deviceInfo['system']]) { - $deviceInfo['systemVersion'] = $systemVersion[$deviceInfo['system']]; - if ($deviceInfo['systemVersion'] == $userAgent) $deviceInfo['systemVersion'] = ''; + if (isset($deviceInfo['system']) && $deviceInfo['system'] !== "" && isset($systemVersion[$deviceInfo['system']])) { + $deviceInfo['systemVersion'] = $systemVersion[$deviceInfo['system']]; + if ($deviceInfo['systemVersion'] == $userAgent) { + $deviceInfo['systemVersion'] = ''; + } } // 浏览器版本信息 @@ -536,9 +538,11 @@ function getBrowsersInfo($userAgent) { ]; - if ($browsersVersion[$deviceInfo['browser']]) { - $deviceInfo["version"] = $browsersVersion[$deviceInfo['browser']]; - if ($deviceInfo["version"] == $userAgent) $deviceInfo['version'] = ''; + if (isset($deviceInfo['browser'], $browsersVersion[$deviceInfo['browser']])) { + $deviceInfo['version'] = $browsersVersion[$deviceInfo['browser']]; + if ($deviceInfo['version'] == $userAgent) { + $deviceInfo['version'] = ''; + } } // 修正浏览器版本信息 @@ -960,7 +964,7 @@ function parse_smiley_shortcode($content) { ]; $themeUrl = Helper::options()->themeUrl . '/assets/img/smiley/'; foreach ($smileys as $code => $img) { - $imgTag = '' . $code . ''; + $imgTag = '' . $code . ''; $content = str_replace($code, $imgTag, $content); } return $content; diff --git a/index.php b/index.php index a5fa178..056d446 100644 --- a/index.php +++ b/index.php @@ -4,7 +4,7 @@ * * @package Typecho Pouck Theme * @author 老孙博客 - * @version 1.1.6 + * @version 1.1.7 * @link http://www.imsun.org */ diff --git a/sidebar.php b/sidebar.php index 5fd5f7e..02a071d 100644 --- a/sidebar.php +++ b/sidebar.php @@ -45,7 +45,7 @@ if ($totalViews === null) $totalViews = 0; ?> options->sidebarBlock) && in_array('ShowAdmin', $this->options->sidebarBlock)): ?>
-
+
' class='lazy avatar' data-src='' >