Movwe the conversion after the cleaning

This commit is contained in:
Michael 2022-05-11 10:56:44 +00:00
parent ffb8491c3f
commit 34f594137e

View File

@ -65,11 +65,11 @@ class Probe
*/ */
public static function cleanURI(string $rawUri): string public static function cleanURI(string $rawUri): string
{ {
$rawUri = Network::convertToIdn($rawUri);
// At first remove leading and trailing junk // At first remove leading and trailing junk
$rawUri = trim($rawUri, "@#?:/ \t\n\r\0\x0B"); $rawUri = trim($rawUri, "@#?:/ \t\n\r\0\x0B");
$rawUri = Network::convertToIdn($rawUri);
$uri = new Uri($rawUri); $uri = new Uri($rawUri);
if (!$uri->getScheme()) { if (!$uri->getScheme()) {
return $uri->__toString(); return $uri->__toString();