Changeset 53455 for trunk/src/wp-includes/formatting.php
- Timestamp:
- 06/01/2022 06:12:25 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r53452 r53455 4355 4355 * @param string[] $protocols Optional. An array of acceptable protocols. 4356 4356 * Defaults to return value of wp_allowed_protocols(). 4357 * @param string $_context Private. Use esc_url_raw() for database usage.4357 * @param string $_context Private. Use sanitize_url() for database usage. 4358 4358 * @return string The cleaned URL after the {@see 'clean_url'} filter is applied. 4359 4359 * An empty string is returned if `$url` specifies a protocol other than … … 4831 4831 $value = explode( "\n", $value ); 4832 4832 $value = array_filter( array_map( 'trim', $value ) ); 4833 $value = array_filter( array_map( ' esc_url_raw', $value ) );4833 $value = array_filter( array_map( 'sanitize_url', $value ) ); 4834 4834 $value = implode( "\n", $value ); 4835 4835 break; … … 4845 4845 } else { 4846 4846 if ( preg_match( '#http(s?)://(.+)#i', $value ) ) { 4847 $value = esc_url_raw( $value );4847 $value = sanitize_url( $value ); 4848 4848 } else { 4849 4849 $error = __( 'The WordPress address you entered did not appear to be a valid URL. Please enter a valid URL.' ); … … 4858 4858 } else { 4859 4859 if ( preg_match( '#http(s?)://(.+)#i', $value ) ) { 4860 $value = esc_url_raw( $value );4860 $value = sanitize_url( $value ); 4861 4861 } else { 4862 4862 $error = __( 'The Site address you entered did not appear to be a valid URL. Please enter a valid URL.' ); … … 4930 4930 $error = $value->get_error_message(); 4931 4931 } else { 4932 $value = esc_url_raw( $value );4932 $value = sanitize_url( $value ); 4933 4933 $value = str_replace( 'http://', '', $value ); 4934 4934 } … … 5581 5581 } 5582 5582 } 5583 $urls_to_ping = array_map( ' esc_url_raw', $urls_to_ping );5583 $urls_to_ping = array_map( 'sanitize_url', $urls_to_ping ); 5584 5584 $urls_to_ping = implode( "\n", $urls_to_ping ); 5585 5585 /** … … 5650 5650 5651 5651 if ( preg_match( '/<a\s[^>]*?href=([\'"])(.+?)\1/is', $content, $matches ) ) { 5652 return esc_url_raw( $matches[2] );5652 return sanitize_url( $matches[2] ); 5653 5653 } 5654 5654
Note: See TracChangeset
for help on using the changeset viewer.