From 055855bf9b2a7f4f14b6d2ef944f49bed5be8687 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 23 Mar 2018 18:41:59 +0000 Subject: [PATCH] Handle URL with unicode characters --- src/Util/Network.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Util/Network.php b/src/Util/Network.php index d25b799242..bbdc51fbbb 100644 --- a/src/Util/Network.php +++ b/src/Util/Network.php @@ -79,6 +79,18 @@ class Network $a = get_app(); + $parts = parse_url($url); + $path_parts = explode('/', $parts['path']); + foreach ($path_parts as $part) { + if (strlen($part) <> mb_strlen($part)) { + $parts2[] = rawurlencode($part); + } else { + $parts2[] = $part; + } + } + $parts['path'] = implode('/', $parts2); + $url = self::unparseURL($parts); + if (self::isUrlBlocked($url)) { logger('domain of ' . $url . ' is blocked', LOGGER_DATA); return $ret; -- 2.39.5