Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127276 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id CD6071A00BC for ; Sat, 3 May 2025 21:18:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1746306994; bh=w/csGuy4uQZFatYqdEiCIRr41PF6HlIAgNPdT91J/04=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=JETygZTa1w3QwA+ilV2QY3YhgFI1fdP5/lu1uT6M2NSf/HVxV0bekORKcpB4JUmwY 4MuRSoNVLziIxyz0fQEj6g081rOhJM7U7jB/9WLqgSVfRTA3QDog7ChCa8/Jpi1G0t bqXjRrc6LXmWMacAN2YFAs07SoVOLuiaNAlH/0bFUFqusrpkiO2Wnoo5N9mQGpR5I1 PuA/gLS5FU/N3j29a7tQMEtd26szvRqUDfS00QHAwQa5tEy+FSvuXFRrRdS7TutWHf cJxttZjFwc4NS+BXB5LOWh3DEd+uS88SjjTi1HHt91nVQfpNNT3JEaSaRJ6H5WhWG7 I3X3inTz8SgFw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3196118003B for ; Sat, 3 May 2025 21:16:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 3 May 2025 21:16:31 +0000 (UTC) Received: by mail-qt1-f180.google.com with SMTP id d75a77b69052e-4811fca8658so39633901cf.3 for ; Sat, 03 May 2025 14:18:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746307126; x=1746911926; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=w/csGuy4uQZFatYqdEiCIRr41PF6HlIAgNPdT91J/04=; b=RM6P96iwWrm4MTVtlJQHPnm3R22LvgVYr8rgCtE2+REAQdN+U7vC/jjCEBvbKYl5JC y8IdJXqaClrOvt9/+fTNqP7yU+T5GTPNdOh7fdj0qHKaPzEKl6+cVA3vLO0LeZ+/S8lQ zskMghZtuPyD1N/aGWEjWPtgSnlxsCn8PPVoEEEPINRH/kDtsIF9oXwK/8TZ67KqjQd1 kV/rhnUDvnU1mTJTlTWPmWTOV+gw+NK5k9YHg1v5S8AhouSq8JxnBmQD6f64gV2ytymJ l2XkWSdVsamCE0DArI9nKXb681OMFrDUDJju+2+2CVgEwCEKFAGgkiu421Nl0vb4pAyI yy+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746307126; x=1746911926; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=w/csGuy4uQZFatYqdEiCIRr41PF6HlIAgNPdT91J/04=; b=CKYGmLGrFGc4sriQr/WEWTDGQ9vq2rk7v5RJM+D1IviRz1fUb6Mw0tykb2brcW8pzb lAWmJ8JO/z2Lje9+t7pAUOk8WbKe9QO53DLA9WaS/QsB57hEfexGtAnH+9xCSnFvuTL8 OMmAKeinmTgQ4YEztKbBhNB+qLav0KHKnKiVJCgDrZKLgCDXRugi2Fri0stZY6IPF5Oq A0p/2y61iwhsqZw4wjKMDImaCFYYfjfe67D/pgW00MLV3oug41BUH9iIPBvgI2n2HOlh GCxxTv3DV3HQXfxPkcOe0t963R4YekDGz111R4/fcUk3o6MVsRiJI/pyDCKtp0C2mwZA gA8w== X-Forwarded-Encrypted: i=1; AJvYcCU8fpko+iN0oylSSI8w0Ux+oGcdcg2jxy+f4jmx4FY1AbBwjj3mRLjnEu9oGhPxodB6s3LQgP2EEHw=@lists.php.net X-Gm-Message-State: AOJu0Yyq8i7q5ZslhdNJh3w4wRtzcG2CJ0js0qmPLSK47H8o5v//8NcW BNhXToRM2dJ81T0+taUEKBhd7sPd5dXtVEqSYxu9Q8qPb1MO8L5SFiqfKbOa5frIwAUTMgamaBG NK5Zfhv3+OeRxBUSZvYltEyQgGYs= X-Gm-Gg: ASbGnctartLBet3ZsrGkZ80Q+ZnFcUdHLat6vRaOMItJN6FvRrq81VlaHCUROjzed8u 3nP8fGADGNnJ/YmoKrpzjQGqt84erPaQAUzP5anZ/4ryWMulND8yIOlziJvHmRF2l2BJbz3EMhY BIcN35hGchcOZHOCx3QtAuSw== X-Google-Smtp-Source: AGHT+IEOvGKq8mk2tkZxPeOzl/FOK+2yN9JY1GssCJhsEKhLfHsTA28vjiLcwo72+9mzij9N91E1HkbGG6B/MsPEK3Y= X-Received: by 2002:ac8:578b:0:b0:48c:4b53:7d03 with SMTP id d75a77b69052e-48d5b95d24dmr64342801cf.3.1746307126254; Sat, 03 May 2025 14:18:46 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <1BCB4144-231D-45EA-A914-98EE8F0F503A@automattic.com> <8E614C9C-BA85-45D8-9A4E-A30D69981C5D@automattic.com> <8df04e01-deac-404b-beb7-cd982423db63@bastelstu.be> <33427cd03035ef084245c44290b56a55@bastelstu.be> <0aa1eefc3941bdea0092e935074daa58@bastelstu.be> <76d96ea8a78c6025128c0a4b01c94c0a@bastelstu.be> In-Reply-To: Date: Sat, 3 May 2025 23:18:35 +0200 X-Gm-Features: ATxdqUE39Z6SrNbRT2Xl4Z03NbrkbRiTzer2vEobFlywcxTwKOczr-cKiAWCutI Message-ID: Subject: Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API To: ignace nyamagana butera Cc: =?UTF-8?Q?Tim_D=C3=BCsterhus?= , PHP Internals List Content-Type: multipart/alternative; boundary="000000000000ede321063441cfbf" From: kocsismate90@gmail.com (=?UTF-8?B?TcOhdMOpIEtvY3Npcw==?=) --000000000000ede321063441cfbf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hey Ignace, > I see you updated the RFC but I believe there's still some errors in the > example: > $url =3D 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=C3=A1t=C3=A9 > --000000000000ede321063441cfbf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hey Ignace,
=C2=A0
I see you updated the RF= C but I believe there's still some errors in the example:
$url =3D= Uri\WhatWg\Url::parse("/foo", ".com"); // Throws Uri\W= hatWg\InvalidUrlException because of $baseUri
= =C2=A0
After following the suggestion of Tim, I changed the type = of the $baseUrl parameters at=C2=A0last: now, an URI/URL instance is
<= div>accepted instead of a string. As Tim mentioned, this can indeed fix som= e performance issues when one uses the same
base URL for instanti= ating multiple URIs/URLs.

RFC3986 host normalization states tha= t URL encoded part should be encoded using uppercased letter so on normaliz= ation:
=
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
=C2=A0
Yes, indeed! This example outp= ut has stuck here from before I fixed the implementation, so thanks for poi= nting it out!

Regards,
M=C3=A1t=C3=A9
--000000000000ede321063441cfbf--