Formatting: Trim leading whitespace in `esc_url()`.

Props toszcze.
Fixes #36369.


Built from https://develop.svn.wordpress.org/trunk@45578


git-svn-id: http://core.svn.wordpress.org/trunk@45389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2019-07-01 03:29:57 +00:00
parent f3ece5149f
commit abc0f7dd32
2 changed files with 2 additions and 2 deletions

View File

@ -4202,7 +4202,7 @@ function esc_url( $url, $protocols = null, $_context = 'display' ) {
return $url; return $url;
} }
$url = str_replace( ' ', '%20', $url ); $url = str_replace( ' ', '%20', ltrim( $url ) );
$url = preg_replace( '|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\[\]\\x80-\\xff]|i', '', $url ); $url = preg_replace( '|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\[\]\\x80-\\xff]|i', '', $url );
if ( '' === $url ) { if ( '' === $url ) {

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.3-alpha-45577'; $wp_version = '5.3-alpha-45578';
/** /**
* 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.