Replace call to parse_url() with Uri instanciation in Util\Proxy

- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1321796513
This commit is contained in:
Hypolite Petovan 2022-11-23 13:41:13 -05:00
parent 0ec7238da4
commit a3fb499735

View file

@ -24,6 +24,7 @@ namespace Friendica\Util;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\DI; use Friendica\DI;
use GuzzleHttp\Psr7\Uri;
/** /**
* Proxy utilities class * Proxy utilities class
@ -173,12 +174,15 @@ class Proxy
*/ */
private static function parseQuery(string $url): array private static function parseQuery(string $url): array
{ {
$query = parse_url($url, PHP_URL_QUERY); try {
$query = html_entity_decode($query); $uri = new Uri($url);
parse_str($query, $arr); parse_str($uri->getQuery(), $arr);
return $arr; return $arr;
} catch (\Throwable $e) {
return [];
}
} }
/** /**