修复:好友悄悄话链接 href 出现字面 \'#\' 导致404问题

PHP 双引号字符串里单引号不需要反斜杠转义,
\'#\' 会原样输出 \'#\' 而非 '#',导致 href 跳转到错误 URL。
改为直接写 '#' 即可。
This commit is contained in:
2026-03-01 01:05:47 +08:00
parent 212f7a0096
commit d60a225368

View File

@@ -222,8 +222,8 @@ class FriendController extends Controller
// 根据操作类型和互相状态生成不同文案(含内联快捷操作链接)
$btnStyle = 'font-weight:bold;text-decoration:underline;margin-left:6px;';
$btnAdd = "<a href=\'#\' onclick=\"quickFriendAction(\'add\',\'{$fromUsername}\',this);return false;\" style=\'color:#16a34a;{$btnStyle}\'> 回加好友</a>";
$btnRemove = "<a href=\'#\' onclick=\"quickFriendAction(\'remove\',\'{$fromUsername}\',this);return false;\" style=\'color:#6b7280;{$btnStyle}\'>🗑️ 同步移除</a>";
$btnAdd = "<a href='#' onclick=\"quickFriendAction('add','{$fromUsername}',this);return false;\" style='color:#16a34a;{$btnStyle}'> 回加好友</a>";
$btnRemove = "<a href='#' onclick=\"quickFriendAction('remove','{$fromUsername}',this);return false;\" style='color:#6b7280;{$btnStyle}'>🗑️ 同步移除</a>";
$content = match ($action) {
'added' => $mutual