脚本处理
This commit is contained in:
@@ -25,25 +25,4 @@ class TbCommand extends Command
|
||||
}
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function replaceRichTextUrls($input) {
|
||||
// 匹配旧域名及其引号包裹情况(包含http/https协议)
|
||||
$pattern = '#(https?://server\.xyh\.hnzhwlkj\.club|["\']https?://server\.xyh\.hnzhwlkj\.club)(/[^\s"\'<>]*)?#iu';
|
||||
|
||||
$replacement = function ($matches) {
|
||||
$originalQuote = '';
|
||||
$path = $matches[2] ?? '';
|
||||
|
||||
// 检测是否以引号开头
|
||||
if (isset($matches[0][0]) && in_array($matches[0][0], ['"', "'"])) {
|
||||
$originalQuote = $matches[0][0];
|
||||
}
|
||||
|
||||
// 构建新URL(强制使用http协议)
|
||||
return $originalQuote . 'http://219.157.255.213:25326' . $path;
|
||||
};
|
||||
|
||||
return preg_replace_callback($pattern, $replacement, $input);
|
||||
}
|
||||
Reference in New Issue
Block a user