mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
#2675 보완 및 최적화
This commit is contained in:
parent
5834a3c18a
commit
c5d453a2df
1 changed files with 2 additions and 2 deletions
|
|
@ -207,7 +207,7 @@ class URL
|
||||||
*/
|
*/
|
||||||
public static function encodeIdna(string $url): string
|
public static function encodeIdna(string $url): string
|
||||||
{
|
{
|
||||||
if (preg_match('@[:/#]@', $url) && !str_starts_with($url, '/'))
|
if (!preg_match('@^/(?!/)@', $url) && preg_match('@[:/#]@', $url))
|
||||||
{
|
{
|
||||||
$domain = parse_url($url, \PHP_URL_HOST);
|
$domain = parse_url($url, \PHP_URL_HOST);
|
||||||
if (!$domain)
|
if (!$domain)
|
||||||
|
|
@ -247,7 +247,7 @@ class URL
|
||||||
*/
|
*/
|
||||||
public static function decodeIdna(string $url): string
|
public static function decodeIdna(string $url): string
|
||||||
{
|
{
|
||||||
if (preg_match('@[:/#]@', $url) && !str_starts_with($url, '/'))
|
if (!preg_match('@^/(?!/)@', $url) && preg_match('@[:/#]@', $url))
|
||||||
{
|
{
|
||||||
$domain = parse_url($url, \PHP_URL_HOST);
|
$domain = parse_url($url, \PHP_URL_HOST);
|
||||||
if (!$domain)
|
if (!$domain)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue