User tests: Successful: Unsuccessful:
No separate issue is linked.
For URL fields allowing relative URLs, detect the current site's hostname followed by a valid boundary rather than comparing the whole input with the hostname. Prepend the protocol for host-plus-path/port/query inputs while retaining normal relative-path handling. Escape the hostname before matching and reject lookalike hostname prefixes.
Run php ./libraries/vendor/bin/phpunit --configuration phpunit.xml.dist --filter UrlFilterTest in a configured Joomla development checkout. The fixture uses host www.example.com and root /joomla. Check hostname-only, path, port, query, uppercase host, lookalike host, relative path, absolute path, and full URL cases. These are reproduction instructions, not a claim of a local test run in this update.
www.example.com/blog/post is treated as a relative path and prefixed with /joomla/.
The result is http://www.example.com/blog/post. A different host such as www.example.com.evil.org/page remains a relative input; ordinary relative and full URLs keep their existing handling.
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
These changes restore preservation of existing URL components rather than introduce a new public API.
| Status | New | ⇒ | Pending |
| Category | ⇒ | Libraries Unit Tests |
| Title |
|
||||||
@Shubham-Padkonde Did you read the Generative AI policy? You will then need to confirm (by tick) that your contribution is compatible with the policy and GNU/GPL 2 or later.
You were given a template to complete for a reason not for fun. Please complete it