Changelog
phil/urlPas encore traduite
Cette page n’est pas encore traduite en français ; elle est montrée en anglais.
All notable changes to phil/url will be documented in this file.
Updates should follow the Keep a CHANGELOG principles.
0.1.3-alpha - 2026-11-11
Added
Url::fromString($text, allowLocalhost: true)acceptslocalhostand the names under.localhost(RFC 6761), for development and tests; an IP address and any other single name stay refused,http://127.0.0.1/,http://localhostx/andhttp://intranet/among them.
Changed
- By default, a name under
.localhost,http://app.localhost/, is refused likelocalhost: both name the loopback address.
0.1.2-alpha - 2026-11-11
Changed
Url::fromString()reads an address as a browser does, on PHP 8.5's URI extension,Uri\WhatWg\Url, by the WHATWG URL Standard: in the path, a backslash is a slash and the segments.and..are resolved, written plainly or escaped (%2e,%2E,.%2e,%2e.); the characters the path, the query or the fragment cannot hold,<,>,"and the letters outside ASCII among them, are percent-encoded, each part by its own set of the standard. An escape already written stays as written,%2Fa character of its segment and never a separator. Its own rules stay:httpandhttpsonly, no user name nor password, an empty one included (https://@example.com/), no port 0, no IP address, the host rules of 0.1.1-alpha. The 2048 characters at most hold for the normalised address too. An IPv4 address written short,http://127.1/, is named127.0.0.1in the message ofInvalidUrl; a top-level domain of digits,https://shop.123/, is refused as no web address, not as no host name.Url::display()shows the escaped letters of the path and the query as letters,example.com/thé; an escape of ASCII, an invisible character, a space or a control stays escaped.phil/urlrequiresext-uri, bundled with PHP 8.5.
Security
path,segments()andequals()now give the path a browser opens:https://example.com/docs/../admin,/docs/%2e%2e/adminand/docs\..\adminhave the path/admin, so an application that allows paths by their prefix,/docs/, can no longer be bypassed.<,>and"are percent-encoded intoString().
0.1.1-alpha - 2026-11-11
Fixed
Url::fromString()throwsInvalidUrl, not ICU'sValueError, for a host made only of dots —https://.,https://...,https://./path— and refuses a host ending with two dots,https://example.com../, whose last label is empty; a single trailing dot is still dropped.
0.1.0-alpha - 2026-11-11
Added
Url:Url::fromString()refuses a host that is an IP address — a top-level domain of digits — and port 0;Url::display()shows an international host in its own letters,bücher.example, unless ICU's spoof checker finds it suspicious,аpple.comin Cyrillic, which stays in ASCII.UrlType,KnownUrlType,TypedUrlandUrlTypes;KnownUrlType::Mastodonaccepts no address on the domains of the other kinds, nor onmedium.com,substack.com,figma.com,vsco.co,behance.net,ko-fi.comandbuymeacoffee.com, whose profiles are also written/@name.KnownUrlType::Pinterestaccepts only the domains Pinterest holds, never anotherpinterest.<tld>.KnownUrlType::YouTubeacceptsyoutube-nocookie.comtoo.CookielessVideo, which turns a YouTube video into its player onyoutube-nocookie.com, its start time kept, and a Vimeo video into its player withdnt=1.UrlExceptionandInvalidUrl, withInvalidUrl::port().- The documentation in
doc/, one file per topic, indexed by the README. CONTRIBUTING.md,SECURITY.mdandCODE_OF_CONDUCT.md.