From bf8f4214e71e99d4a183b9bed36b6b26be0439d6 Mon Sep 17 00:00:00 2001 From: jd82k Date: Tue, 23 Apr 2024 00:41:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dajax=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E8=AF=84=E8=AE=BA=E4=B8=8D=E6=98=BE=E7=A4=BAUA=E3=80=81IP?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/fun/comment-ajax.php | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/inc/fun/comment-ajax.php b/inc/fun/comment-ajax.php index c26d2893..bb94ab67 100755 --- a/inc/fun/comment-ajax.php +++ b/inc/fun/comment-ajax.php @@ -1,5 +1,6 @@ comment_approved == '0') { - $comment_approved_str = '

您的评论正在等待审核!

'; + $comment_approved_str = '

您的评论正在等待审核!

'; } wp_set_comment_cookies($comment, $user); @@ -190,10 +191,29 @@ function pk_comment_ajax()
' . get_comment_date('Y-m-d H:i:s', $comment_id) . '
-
-
- ' . get_comment_text($comment_id) . ' +
+
+

' . get_comment_text($comment_id) . '

' . $comment_approved_str . ' +
'; + + if (pk_is_checked('comment_show_ua', true)): + $commentUserAgent = parse_user_agent($comment->comment_agent); + $commentOsIcon = pk_get_comment_ua_os_icon($commentUserAgent['platform']); + $commentBrowserIcon = pk_get_comment_ua_os_icon($commentUserAgent['browser']); + echo " {$commentUserAgent['platform']} "; + echo " {$commentUserAgent['browser']}"; + endif; + ?> + user_id != 1)) { + $ip = pk_get_ip_region_str($comment->comment_author_IP); + echo " $ip"; + } + } + + echo '
'; From 87a84fb3a35901aecb7682f7325ce7d1fb89a87b Mon Sep 17 00:00:00 2001 From: jd82k Date: Tue, 23 Apr 2024 02:42:50 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dajax=E4=B8=8D=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E6=98=BE=E7=A4=BA=E8=AF=84=E8=AE=BA=E7=AD=89=E7=BA=A7?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/fun/comment-ajax.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/fun/comment-ajax.php b/inc/fun/comment-ajax.php index bb94ab67..a0fcae37 100755 --- a/inc/fun/comment-ajax.php +++ b/inc/fun/comment-ajax.php @@ -175,7 +175,7 @@ function pk_comment_ajax() $comment_approved_str = ''; if ($comment->comment_approved == '0') { - $comment_approved_str = '

您的评论正在等待审核!

'; + $comment_approved_str = '

您的评论正在等待审核!

'; } wp_set_comment_cookies($comment, $user); @@ -186,7 +186,7 @@ function pk_comment_ajax()
' . get_comment_author_link($comment_id) . ' - ' . pk_the_author_class(false, $comment) . ' + ' . (pk_is_checked('comment_level') ? pk_the_author_class(false, $comment) : '') . '
' . get_comment_date('Y-m-d H:i:s', $comment_id) . '
From f4d05c3a8aae120b8eae26058db4618e472f4ad9 Mon Sep 17 00:00:00 2001 From: jd82k Date: Tue, 23 Apr 2024 16:26:27 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3php7=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E5=87=BD=E6=95=B0=E5=85=BC=E5=AE=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/fun/core.php | 4 ++-- inc/init.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/inc/fun/core.php b/inc/fun/core.php index 7be38265..b8f64a4f 100755 --- a/inc/fun/core.php +++ b/inc/fun/core.php @@ -909,13 +909,13 @@ function pk_get_ip_region_str($ip) } catch (Exception $e) { return '未知'; } - if (str_contains($s['region'], '内网IP')) { + if (strpos($s['region'], '内网IP') !== false) { return '内网IP'; } $region = explode('|', $s['region']); $res = ''; foreach ($region as $item) { - if (str_starts_with($item, '0')) { + if (strpos($item, '0') === 0) { continue; } $res .= $item; diff --git a/inc/init.php b/inc/init.php index 029aab80..776952f4 100755 --- a/inc/init.php +++ b/inc/init.php @@ -224,7 +224,7 @@ function pk_init_register_assets() add_filter('style_loader_tag', 'pk_assets_href_handle', 10, 3); function pk_assets_scr_handle($tag, $handle, $source) { - if (str_starts_with($handle, 'puock') && strpos($source,'instant=true')===false) + if (strpos($handle, 'puock') === 0 && strpos($source,'instant=true')===false) { $tag = str_replace(' src', ' data-no-instant src', $tag); } @@ -233,7 +233,7 @@ function pk_assets_scr_handle($tag, $handle, $source) function pk_assets_href_handle($tag, $handle, $source) { - if (str_starts_with($handle, 'puock') && strpos($source,'instant=true')===false) { + if (strpos($handle, 'puock') === 0 && strpos($source,'instant=true')===false) { $tag = str_replace(' href', ' data-no-instant href', $tag); } return $tag;