修正 Proxied、 SSL/TLS 设为 Flexible、开启 Always Use HTTPS

This commit is contained in:
root
2026-06-10 06:44:57 +08:00
parent a68b83fcbd
commit 5dea4c8b28
31 changed files with 950 additions and 160 deletions
@@ -11,9 +11,15 @@ class SplitFriendUrlBuilder
{
/**
* 构建跳转 URL;无法构建时返回空字符串
*
* @param string $whatsAppReplyText 仅 WhatsApp 类型使用,预填消息文案(urlencode 在内部处理)
*/
public static function build(string $numberType, string $number, string $numberTypeCustom = ''): string
{
public static function build(
string $numberType,
string $number,
string $numberTypeCustom = '',
string $whatsAppReplyText = ''
): string {
$number = trim($number);
if ($number === '') {
return '';
@@ -21,7 +27,7 @@ class SplitFriendUrlBuilder
switch ($numberType) {
case 'whatsapp':
return self::buildWhatsApp($number);
return self::buildWhatsApp($number, $whatsAppReplyText);
case 'telegram':
return self::buildTelegram($number);
case 'line':
@@ -34,16 +40,22 @@ class SplitFriendUrlBuilder
}
/**
* WhatsApphttps://api.whatsapp.com/send?phone= 仅数字
* WhatsApphttps://api.whatsapp.com/send?phone= 仅数字,可选 &text= 预填消息
*/
private static function buildWhatsApp(string $number): string
private static function buildWhatsApp(string $number, string $replyText = ''): string
{
$digits = preg_replace('/\D+/', '', $number) ?? '';
if ($digits === '') {
return '';
}
return 'https://api.whatsapp.com/send?phone=' . $digits;
$url = 'https://api.whatsapp.com/send?phone=' . $digits;
$replyText = trim($replyText);
if ($replyText !== '') {
$url .= '&text=' . rawurlencode($replyText);
}
return $url;
}
/**