mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Bail out early from esc_url()
if the URL becomes empty after stripping out disallowed characters.
Fixes #28015 Props jesin for the unit test Built from https://develop.svn.wordpress.org/trunk@33923 git-svn-id: http://core.svn.wordpress.org/trunk@33892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9e6f9a5d93
commit
bdde0261bc
@ -3277,6 +3277,11 @@ function esc_url( $url, $protocols = null, $_context = 'display' ) {
|
|||||||
|
|
||||||
$url = str_replace( ' ', '%20', $url );
|
$url = str_replace( ' ', '%20', $url );
|
||||||
$url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\\x80-\\xff]|i', '', $url);
|
$url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\\x80-\\xff]|i', '', $url);
|
||||||
|
|
||||||
|
if ( '' === $url ) {
|
||||||
|
return $url;
|
||||||
|
}
|
||||||
|
|
||||||
if ( 0 !== stripos( $url, 'mailto:' ) ) {
|
if ( 0 !== stripos( $url, 'mailto:' ) ) {
|
||||||
$strip = array('%0d', '%0a', '%0D', '%0A');
|
$strip = array('%0d', '%0a', '%0D', '%0A');
|
||||||
$url = _deep_replace($strip, $url);
|
$url = _deep_replace($strip, $url);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.4-alpha-33922';
|
$wp_version = '4.4-alpha-33923';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user