Re: [RFC] [Discussion] Add WHATWG compliant URL parsing API

From: Date: Sat, 03 May 2025 21:18:35 +0000
Subject: Re: [RFC] [Discussion] Add WHATWG compliant URL parsing API
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hey Ignace,


> I see you updated the RFC but I believe there's still some errors in the
> example:
> $url = Uri\WhatWg\Url::parse("/foo", ".com"); // Throws
> Uri\WhatWg\InvalidUrlException because of $baseUri
>

After following the suggestion of Tim, I changed the type of the $baseUrl
parameters at last: now, an URI/URL instance is
accepted instead of a string. As Tim mentioned, this can indeed fix some
performance issues when one uses the same
base URL for instantiating multiple URIs/URLs.

RFC3986 host normalization states that URL encoded part should be encoded
> using uppercased letter so on normalization:
>
https://%e4%bd%a0%e5%a5%bd%e4%bd%a0%e5%a5%bd.com
should be https://
> %E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD.com
>

Yes, indeed! This example output has stuck here from before I fixed the
implementation, so thanks for pointing it out!

Regards,
Máté

>


Thread (152 messages)

« previous php.internals (#127276) next »