From eae306d5bf5c69965877eee86ffa6ad808457248 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 11 May 2020 20:32:06 +0000 Subject: [PATCH] Docs: Add a note that the `$protocols` parameter of `esc_url_raw()` defaults to return value of `wp_allowed_protocols()`. This complements already existing note in `esc_url()`. Props audrasjb. Fixes #50147. git-svn-id: https://develop.svn.wordpress.org/trunk@47783 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/formatting.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index 130a2c36d1..8854d2f34e 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -4300,9 +4300,9 @@ function esc_sql( $data ) { * * @param string $url The URL to be cleaned. * @param string[] $protocols Optional. An array of acceptable protocols. - * Defaults to return value of wp_allowed_protocols() + * Defaults to return value of wp_allowed_protocols(). * @param string $_context Private. Use esc_url_raw() for database usage. - * @return string The cleaned $url after the {@see 'clean_url'} filter is applied. + * @return string The cleaned URL after the {@see 'clean_url'} filter is applied. */ function esc_url( $url, $protocols = null, $_context = 'display' ) { $original_url = $url; @@ -4408,7 +4408,8 @@ function esc_url( $url, $protocols = null, $_context = 'display' ) { * @since 2.8.0 * * @param string $url The URL to be cleaned. - * @param string[] $protocols An array of acceptable protocols. + * @param string[] $protocols Optional. An array of acceptable protocols. + * Defaults to return value of wp_allowed_protocols(). * @return string The cleaned URL. */ function esc_url_raw( $url, $protocols = null ) {