fix: harden url mapping validation
This commit is contained in:
@@ -125,6 +125,19 @@ if ( ! function_exists( 'esc_url_raw' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'wp_parse_url' ) ) {
|
||||
/**
|
||||
* Minimal URL parser for unit tests.
|
||||
*
|
||||
* @param string $url URL to parse.
|
||||
* @return array<string, mixed>|false
|
||||
*/
|
||||
function wp_parse_url( $url ) {
|
||||
// phpcs:ignore WordPress.WP.AlternativeFunctions.parse_url_parse_url -- Test stub for WordPress' wp_parse_url().
|
||||
return parse_url( $url );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'get_option' ) ) {
|
||||
/**
|
||||
* Minimal WordPress option reader for unit tests.
|
||||
|
||||
Reference in New Issue
Block a user