[wp-trac] [WordPress Trac] #64457: Avoid underscores for hosts in wp_http_validate_url
WordPress Trac
noreply at wordpress.org
Mon Dec 29 01:52:20 UTC 2025
#64457: Avoid underscores for hosts in wp_http_validate_url
-------------------------+-----------------------------
Reporter: SirLouen | Owner: (none)
Type: enhancement | Status: new
Priority: low | Milestone: Awaiting Review
Component: HTTP API | Version:
Severity: normal | Keywords: 2nd-opinion
Focuses: performance |
-------------------------+-----------------------------
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.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64457>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list