为vless订阅链接增加转义。

This commit is contained in:
root
2023-08-15 01:27:36 +09:00
parent 8259f40175
commit 29c1691086
5 changed files with 21 additions and 20 deletions

View File

@ -126,4 +126,8 @@ class Helper
$encoded = base64_encode($data);
return str_replace(['+', '/', '='], ['-', '_', ''], $encoded);
}
public static function encodeURIComponent($str) {
$revert = array('%21'=>'!', '%2A'=>'*', '%27'=>"'", '%28'=>'(', '%29'=>')');
return strtr(rawurlencode($str), $revert);
}
}