Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复ajax提交评论不显示UA、IP的bug #408

Merged
merged 3 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
修正php7字符串函数兼容性
  • Loading branch information
jd82k committed Apr 23, 2024
commit f4d05c3a8aae120b8eae26058db4618e472f4ad9
4 changes: 2 additions & 2 deletions inc/fun/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions inc/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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;
Expand Down