-
Notifications
You must be signed in to change notification settings - Fork 85
activitypub_cache_is_safe_url
github-actions[bot] edited this page Feb 25, 2026
·
2 revisions
Filters whether a URL passes safety validation.
By default, uses wp_http_validate_url() which prevents SSRF attacks by blocking private IPs and localhost. This filter allows overriding for testing or custom validation needs.
or null to use default wp_http_validate_url() check.
/**
* Filters whether a URL passes safety validation.
*
* By default, uses wp_http_validate_url() which prevents SSRF attacks
* by blocking private IPs and localhost. This filter allows overriding
* for testing or custom validation needs.
*
*
* or null to use default wp_http_validate_url() check.
*
* @param bool $is_safe
* @param string $url
* @return bool The filtered value.
*/
function my_activitypub_cache_is_safe_url_callback( bool $is_safe = null, string $url ) {
// Your code here.
return null;
}
add_filter( 'activitypub_cache_is_safe_url', 'my_activitypub_cache_is_safe_url_callback', 10, 2 );-
bool|null$is_safeWhether the URL is safe. Return true/false to override, -
string$urlThe URL being validated.
\apply_filters( 'activitypub_cache_is_safe_url', null, $url )Follow @[email protected] for updates and news.