[wp-trac] [WordPress Trac] #64457: Early filter invalid hosts in wp_http_validate_url (was: Avoid underscores for hosts in wp_http_validate_url)
WordPress Trac
noreply at wordpress.org
Mon Dec 29 14:05:05 UTC 2025
#64457: Early filter invalid hosts in wp_http_validate_url
-------------------------+-----------------------------
Reporter: SirLouen | Owner: (none)
Type: enhancement | Status: new
Priority: low | Milestone: Future Release
Component: HTTP API | Version:
Severity: normal | Resolution:
Keywords: needs-patch | Focuses: performance
-------------------------+-----------------------------
Description changed by SirLouen:
Old description:
> A little performance improvement in `wp_http_validate_url`, early
> returning in the presence of underscores.
>
> Theoretically, a hostname check for a TLD with underscores will never
> succeed when calling `gethostbyname` but given how “expensive” in
> performance this function is, maybe early returning for a `$host` in the
> presence of underscores will save that call for certain malformed URLs.
New description:
A little performance improvement in `wp_http_validate_url`, early
returning in the presence of invalid values.
Theoretically, a hostname check for a TLD with underscores will never
succeed when calling `gethostbyname` but given how “expensive” in
performance this function is, maybe early returning for a `$host` in the
presence of any invalid value will save that call for certain malformed
URLs.
--
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64457#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list