From a3fb499735b47442eacf6c2b00496f499c39a26f Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 23 Nov 2022 13:41:13 -0500 Subject: [PATCH] Replace call to parse_url() with Uri instanciation in Util\Proxy - Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1321796513 --- src/Util/Proxy.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Util/Proxy.php b/src/Util/Proxy.php index fc7d369ad5..aad09d118b 100644 --- a/src/Util/Proxy.php +++ b/src/Util/Proxy.php @@ -24,6 +24,7 @@ namespace Friendica\Util; use Friendica\Core\Logger; use Friendica\Core\System; use Friendica\DI; +use GuzzleHttp\Psr7\Uri; /** * Proxy utilities class @@ -173,12 +174,15 @@ class Proxy */ private static function parseQuery(string $url): array { - $query = parse_url($url, PHP_URL_QUERY); - $query = html_entity_decode($query); + try { + $uri = new Uri($url); - parse_str($query, $arr); + parse_str($uri->getQuery(), $arr); - return $arr; + return $arr; + } catch (\Throwable $e) { + return []; + } } /**