Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124529 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 0D27B1A00B7 for ; Sun, 21 Jul 2024 11:20:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1721560928; bh=C7AqmjPFnMwbCjPBYH9Zvcr+KD1sc6sSz1dKsG7Yb9g=; h=Date:Subject:To:References:From:In-Reply-To:From; b=ARPqcPXkbhd6WHwmeHQ1Qd8DPb7gH/qgrCpCsFYVqqXH4bm8nLNMW+DMjvu2h/Uv6 o2SWnYcRk/5gofaZ1S0CoU5Lrrg0jdy0ukFGfRqawP2AOHcAuRzTgnsf98mib5S/8c b5Xj4APXYZbU3heLjW5GywnRKN9izrl2sIxJRnjEZvh6+N2z36Vix2kFU5FOYJcuZ0 pwfEsDq2PLAo+ojnI1Kzf929LO+R0HIDzZ+inmI0zDSSYcTC0MjucMub3PaNISSZX1 WUWQbxa9Ag9N36Sx8w3KMi4dAglAZuaXOGMZTqnLEqFtyxn/b/iaspck1+SQMpLJyA fWNEiWMXourNg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 793A318003F for ; Sun, 21 Jul 2024 11:22:07 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 ; Sun, 21 Jul 2024 11:22:06 +0000 (UTC) Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-427b4c621b9so21780535e9.1 for ; Sun, 21 Jul 2024 04:20:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721560833; x=1722165633; darn=lists.php.net; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=l++5SaUhx4a5ImIJW//HYE9byOpuPQZOmyZ6dlfGJss=; b=MFRhThKPpMAKxNPGW3E/dP0VwIsGvx8f5ftr3jZwbBtdOlg174X9BCv1EJAZLhYpzi AHHHHEm7mdNYvfp+7yy/JLbFgLfiVJPR2a5GULhkNxqcUY58FPwBQ1LfXgVcVdCqajm/ kDDSoCd041R9Uz6F5CFmXPuOH4kjxg20PKC9hOHYicNRR6ysI+wxhpJMDl0evG0TyGR3 dVefCd0bBriccZ+D9ulKDdfhQMa9f7HuvPX95UEXL3zsDSAlu4JCktkCXctGCmPqSi0A tNrdrQGUcL1x6bxpnf+lE5+mc+4En8SmzjxW80KnYuG7e64SvAxVaIMu9Jm8OB1nGZ27 Sp7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721560833; x=1722165633; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=l++5SaUhx4a5ImIJW//HYE9byOpuPQZOmyZ6dlfGJss=; b=lWFEeZWZzUaEhG1P1jTRY2nv8OrFsNPta8UL52xWHpbDyHk8S72rBWPT78bE7gFXtn 05+16dBPtegs9wIPmacVZ/00ZuUeOhFT+WcmtyCDjBCGwBKldnb5hrmn1veBNxSON5eJ TZ20gMThunmiwvQ1FNOrMuYt5N2fvJovCKbWQgZnEJG3toEpC6b0KPnCzm8S7AqoRy+v 9KuEQ0qHIvTR+ZFHNYaOvEhwluvG39yymEoSIfl8lyvqcFgdeuf7D+Vx72nmryvxFl2v 0jlro2jJaA64+rR5hqtqWvkhX7SNAr2kf8AyUMrsfZgmV2ZpXQevX0LvOWmnk7lcbBri MQdg== X-Gm-Message-State: AOJu0YzenmtqX6s4ciDK8fm5tkN0XMAGrZ5Ngek7fXwDfyUv/5CwuVAq apqJvuT3a53lkgCQbhOTbK384eRAt0Yvc9saWM9QXL9IAbI/Ex8JpdmOpLYG X-Google-Smtp-Source: AGHT+IGAyBMVv/Y1IlnimP/6vw25qR4D4qWjdoavKR4dcSKQB0bJdL3oREue4SUaW45/DPRSohi8/g== X-Received: by 2002:a05:600c:1d21:b0:426:5440:854a with SMTP id 5b1f17b1804b1-427daa1b9damr29010925e9.1.1721560833162; Sun, 21 Jul 2024 04:20:33 -0700 (PDT) Received: from [192.168.0.103] (178-117-134-240.access.telenet.be. [178.117.134.240]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-368787cee03sm5775193f8f.76.2024.07.21.04.20.32 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 21 Jul 2024 04:20:32 -0700 (PDT) Message-ID: Date: Sun, 21 Jul 2024 13:21:39 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API To: internals@lists.php.net References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: dossche.niels@gmail.com (Niels Dossche) On 28/06/2024 22:06, Máté Kocsis wrote: > Hi Everyone, > > I've been working on a new RFC for a while now, and time has come to present it to a wider audience. > > Last year, I learnt that PHP doesn't have built-in support for parsing URLs according to any well established standards (RFC 1738 or the WHATWG URL living standard), since the parse_url() function is optimized for performance instead of correctness. > > In order to improve compatibility with external tools consuming URLs (like browsers), my new RFC would add a WHATWG compliant URL parser functionality to the standard library. The API itself is not final by any means, the RFC only represents how I imagined it first. > > You can find the RFC at the following link: https://wiki.php.net/rfc/url_parsing_api > > Regards, > Máté > Hi Máté Something that I thought about lately is how the existing URL parser in PHP is used in various different places. So for example, in the http fopen wrapper or in the filter extension we rely on the built-in URL parser. I think it would be beneficial if a URL parser was "pluggable" and the url extension could be used instead of the current one for those usages (opt-in). Kind regards Niels