Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127069 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 qa.php.net (Postfix) with ESMTPS id E675C1A00BC for ; Mon, 7 Apr 2025 23:00:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1744066694; bh=sisAS6Ug0PinsSVjbN32S8nH0SQMxAbMY+XxJ8cdOOM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=NfEz06U79v8YpcBDZjwiTySt+dXCzhat0dkqcVii7o9DV9A1snidrNB2SKYdTMMrO +XYVUQFnyzf3j7lYanbcxUxuiQ2uJldEhd2h8HnS9l0s0OGXed3oRmGUolBN+YvMmr E8rGHa7UYzhtQRcR+y2hhxkKW5SvI0a1OIlEQt0aV9+3nWg8yHOdgA5JPPRbtuHtHW nFVyB124Hh8tGh5rzpyAkJK9WZmmgmZ8rZJYNuXtjdAW2BZb8s7MsHoGLiJ/tBho0p pi2porcR7BZcBLJYKyEqCzO2m6eUpZSI519+r+1WBu/QHliI+jMRNFHmrodgomkMem Ctf9lWQRCoNCA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D1675180034 for ; Mon, 7 Apr 2025 22:58:12 +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.9 required=5.0 tests=BAYES_50,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: No X-Envelope-From: Received: from mail-qt1-f182.google.com (mail-qt1-f182.google.com [209.85.160.182]) (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 ; Mon, 7 Apr 2025 22:58:12 +0000 (UTC) Received: by mail-qt1-f182.google.com with SMTP id d75a77b69052e-477296dce8dso49732741cf.3 for ; Mon, 07 Apr 2025 16:00:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744066836; x=1744671636; 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=sisAS6Ug0PinsSVjbN32S8nH0SQMxAbMY+XxJ8cdOOM=; b=akn9fKhEVgX6ReGnK2l2SHNmoLAfBkaLdj26FIcT4V1sFjKuJ7pokGadIXymZPlb9d zxc2/qj9EZVxQ7j1IypgoOBjCN2j5+fan3ukQVdBWq8U1a5IQ3r2SO7T6/09aTNb8soN 7pqGEp8gA3ohQDgIFFwG59twuYhXruTVESIqJ4S48GTUOtEXu7Isp9jB9nOpuy01nhN3 9t6bzZDUn/u0zJceY/48SrA1K4SufcDdByRuEF3zb72gAN6dmk93Hu8Fjn8tosYCZVYs fv6Td008leH+usBxrbQAEvWPeWmuwum/O0sN2j4SpSoL0n1o/SIecyynnvIFrJ/IN2aO 9jew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744066836; x=1744671636; 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=sisAS6Ug0PinsSVjbN32S8nH0SQMxAbMY+XxJ8cdOOM=; b=DcymBDOmVaHH3ckp5c7bKCwFLzbTZqOtoeCH5bZPXlnP2HkriesIlu89sKevCrY7mf 6UHSVKIZOOh4vRXV6lZrEAN+CociUz82KRvP068S4A5F3f5V9xGxW5McSQf80pbQqCCs NXTsv1JRJITWmMzuMzGfo6d2PBn8MGjqF8Oh9zC0DibcQIqJvgn5d7sMjIPfPXqeTxU8 kBn83KrBGfYUKr7aa4lRewxRz9MjOi8pBGSXT1pn4K9g/hjO+j4Tc9d9fJhI4pihRahH y3pwFsw1qCbVexM6esmceVfcOn0zsaIrh+ep1EamYsP9fIl0+CVUm/2WIHZJ6rILUd3U IyDA== X-Gm-Message-State: AOJu0YyOeDNVCwUmumZFBM68zv+f1Uc7a2v1n3jpkY0ogyy/vlw3S1nt 5YMs3Tt2xIivcSXw7aumYWBppkqI1mLW1VB/9OmmmDA46JG5v1rjET15t31oXQsAEc10RooiVwX koFC+1dFBPcmvUaAYQHCUTmVN98xGbnJlcXg= X-Gm-Gg: ASbGncuGnRONa5iiCR5Fcfa4OtdEAnNp6pxngLvOon4E7OJ8CDNxZLOvPTQbJnwT7yM dDje2C1oK3nZ7G3OxP4K6pfhQwa61VgsWCCkFjDsaX/UwVXyiTjzzi17aOn9q9n8NYexi8K3N3D z/FVKqKnn5zW8OsG1dslg5IqxE X-Google-Smtp-Source: AGHT+IEFtjvOIORtMTwXh8rsIJctUSWA+DIwSJCe+Hor1E6XV7Afm8OF2BNlQjA7XfnAgprjUq5LWMx7EqrWRWQyhB0= X-Received: by 2002:a05:622a:189d:b0:477:64b0:6a2a with SMTP id d75a77b69052e-4792495af3dmr191513731cf.26.1744066836447; Mon, 07 Apr 2025 16:00:36 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <8b7044d1-fde1-4701-a914-a63c8ca67099@app.fastmail.com> In-Reply-To: Date: Tue, 8 Apr 2025 00:00:25 +0100 X-Gm-Features: ATxdqUEX3U5X2jBZSgOuOB_yZ6W0_DaxMtzgrMczeQ1OdYFDaBRkck8VtwVjKsk Message-ID: Subject: Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API To: Ignace Nyamagana Butera Cc: php internals Content-Type: multipart/alternative; boundary="00000000000040488e063238342b" From: kocsismate90@gmail.com (=?UTF-8?B?TcOhdMOpIEtvY3Npcw==?=) --00000000000040488e063238342b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hey Ignace, (let me answer in the original thread, as apparently the discussion continued in a separate thread from the main one) > - I believe during normalization of IPv6 host the letter a-f should be > lowercase in accordance with the RFC since > > RFC3986 follows https://www.rfc-editor.org/rfc/rfc3513 which has been > replaced by https://www.rfc-editor.org/rfc/rfc4291 which is updated by > https://www.rfc-editor.org/rfc/rfc5952#section-4.3 which recommends > lowecasing the letters. (yeah that was quite a digging I know =F0=9F=99= =82 ) > That's quite a long chain of RFC updates.... But yes, RFC 3986 explicitly mentions this here: Although host is case-insensitive, producers and normalizers should use > lowercase for registered names and hexadecimal addresses for the sake of > uniformity, while only using uppercase letters for percent-encodings. And that's what the current implementation does. :) > - Since the withers expect well encoded components does it means that it > is the same for the constructor. What is > > the expected result for the following code ? > > ```php > > $uri =3D new Uri\Rfc3986\Uri("https://example,com/?foo[]=3D1&foo[]=3D2" <= https://example,com/?foo[]=3D1&foo[]=3D2>); > ``` > > Should the above trigger an exception because the query component contain= invalid characters or > is it acceptable ? Asking because currently our dear old parse_url does n= ot fail on this and > probably most PHP developers expect this not to fail. > > IMHO I am in favor of it failing to get a consistent experience when usin= g the class because > otherwse you introduce an inconsistency between the constructor behaviour= and the rest of the class > API. > > Yes, generally, creation or any mutation of Uri\Rfc3986\Uri fails when the URI is invalid, exactly in order to offer a consistent experience. Regards, M=C3=A1t=C3=A9 > --00000000000040488e063238342b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hey Ignace,

(let me answer in the original thread, as apparent= ly the discussion continued in a separate thread from the main one)
=

- I believe during normalization of IPv6 host the letter a-f should= be lowercase in accordance with the RFC since

RFC3986 follows=C2= =A0htt= ps://www.rfc-editor.org/rfc/rfc3513=C2=A0which has been replaced by=C2= =A0htt= ps://www.rfc-editor.org/rfc/rfc4291=C2=A0which is updated by=C2=A0https://www.rfc-editor.org/rfc/rfc5952#section-4.3=C2=A0which recommen= ds lowecasing the letters. (yeah that was quite a digging I know=C2=A0=F0= =9F=99=82=C2=A0)

That's quite a long chain o= f RFC updates.... But yes, RFC 3986 explicitly mentions this here:

Although= host is case-insensitive, producers and normalizers should use lowercase f= or registered names and hexadecimal addresses for the sake of uniformity, w= hile only using uppercase letters for percent-encodings.

And that's what=C2=A0the current implementation does. :)
=

--00000000000040488e063238342b--