diff --git a/code/app/common.php b/code/app/common.php index 170035f..3a19cb7 100644 --- a/code/app/common.php +++ b/code/app/common.php @@ -68,14 +68,16 @@ namespace { function replaceLastPageNumber($url, $number) { + $url = (string)($url ?? ''); // 使用正则表达式替换最后一个 "1" 为 "number" - return preg_replace('/1(?=[^1]*$)/', $number, (string)$url); + return preg_replace('/1(?=[^1]*$)/', $number, $url); } function removeScriptTags($rpText, $newText) { + $newText = (string)($newText ?? ''); // 使用正则表达式替换所有