Skip to content

Commit

Permalink
改用pk_is_cur_site判断是否是本站
Browse files Browse the repository at this point in the history
  • Loading branch information
Lvshujun0918 committed Mar 25, 2024
1 parent 5fae991 commit 0933de2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion inc/fun/opt.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ function pk_go_link($url, $name = '')
//检测链接是否属于本站
function pk_is_cur_site($url)
{
if (strpos($url, home_url()) === 0) {
if (str_starts_with($url, home_url()) === 0) {
return true;
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion inc/go.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
if (strpos($url, "https://") !== 0 && strpos($url, "http://") !== 0) {
$error = "跳转链接协议有误";
} else {
if (str_starts_with($url, home_url()) === 0) {
if (pk_is_cur_site($url)) {
header("Location:" . $url);
exit();
}
Expand Down

0 comments on commit 0933de2

Please sign in to comment.