[wp-trac] [WordPress Trac] #64457: Early filter invalid hosts in wp_http_validate_url
WordPress Trac
noreply at wordpress.org
Mon Dec 29 16:57:22 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
-------------------------+-----------------------------
Comment (by SirLouen):
Replying to [comment:6 westonruter]:
> Unless the situation has changed, I don't believe we can use
`filter_var()`. See https://github.com/WordPress/wordpress-
develop/blob/1bd29b14806f471f3ba1df0dc0e86b6aaae27b1e/src/wp-
includes/functions.php#L7326-L7327
[https://github.com/WordPress/wordpress-
develop/pull/4076#discussion_r1107766848 Weird]
But like `iconv`, `filter` is recommended but not forced
https://make.wordpress.org/hosting/handbook/server-environment/
In this case, like we can see in other places, basically what I would do
is a conditional `function_exists`, for those who have this, they will get
a little performance upgrade; for those who doesn't, they will have to
rely on `gethostbyname`
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64457#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list