From 28df9fa4f7d901632e7fd6e23b6d7dd345f1f6e7 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 22 Oct 2017 13:50:20 +0200 Subject: INTL_IDNA_VARIANT_2003 is deprecated See https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003 --- application/Url.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'application/Url.php') diff --git a/application/Url.php b/application/Url.php index b3759377..21c17ecc 100644 --- a/application/Url.php +++ b/application/Url.php @@ -260,7 +260,7 @@ class Url if (! function_exists('idn_to_ascii') || ! isset($this->parts['host'])) { return $out; } - $asciiHost = idn_to_ascii($this->parts['host']); + $asciiHost = idn_to_ascii($this->parts['host'], 0, INTL_IDNA_VARIANT_UTS46); return str_replace($this->parts['host'], $asciiHost, $out); } -- cgit v1.2.3 From d2d4f993e1e76bc68b65c48cb18476c404c97a41 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Wed, 28 Feb 2018 22:34:40 +0100 Subject: PSR: use elseif instead of else if See https://www.php-fig.org/psr/psr-2/\#51-if-elseif-else --- application/Url.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'application/Url.php') diff --git a/application/Url.php b/application/Url.php index 21c17ecc..6b9870f0 100644 --- a/application/Url.php +++ b/application/Url.php @@ -81,7 +81,7 @@ function whitelist_protocols($url, $protocols) // Protocol not allowed: we remove it and replace it with http if ($protocol === 1 && ! in_array($match[1], $protocols)) { $url = str_replace($match[0], 'http://', $url); - } else if ($protocol !== 1) { + } elseif ($protocol !== 1) { $url = 'http://' . $url; } return $url; -- cgit v1.2.3 From f211e417bf637b8a83988175c29ee072c69f7642 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Sat, 13 Oct 2018 00:19:03 +0200 Subject: lint: apply phpcbf to application/ Signed-off-by: VirtualTam --- application/Url.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'application/Url.php') diff --git a/application/Url.php b/application/Url.php index 6b9870f0..3b7f19c2 100644 --- a/application/Url.php +++ b/application/Url.php @@ -34,8 +34,8 @@ function unparse_url($parsedUrl) */ function cleanup_url($url) { - $obj_url = new Url($url); - return $obj_url->cleanup(); + $obj_url = new Url($url); + return $obj_url->cleanup(); } /** @@ -47,8 +47,8 @@ function cleanup_url($url) */ function get_url_scheme($url) { - $obj_url = new Url($url); - return $obj_url->getScheme(); + $obj_url = new Url($url); + return $obj_url->getScheme(); } /** @@ -217,7 +217,7 @@ class Url } $this->parts['query'] = implode('&', $queryParams); - } + } /** * Removes undesired fragments @@ -269,7 +269,8 @@ class Url * * @return string the URL scheme or false if none is provided. */ - public function getScheme() { + public function getScheme() + { if (!isset($this->parts['scheme'])) { return false; } @@ -281,7 +282,8 @@ class Url * * @return string the URL host or false if none is provided. */ - public function getHost() { + public function getHost() + { if (empty($this->parts['host'])) { return false; } @@ -293,7 +295,8 @@ class Url * * @return true is HTTP, false otherwise. */ - public function isHttp() { + public function isHttp() + { return strpos(strtolower($this->parts['scheme']), 'http') !== false; } } -- cgit v1.2.3