fix: harden url mapping validation
This commit is contained in:
1 parent
8d7abc8536
commit
4880613b67
4 files changed
+95
-6
No files matched your search
@@ -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