From abc0f7dd325dd189999f8b4c1c136dbb50cd68cc Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 1 Jul 2019 03:29:57 +0000 Subject: [PATCH] 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 --- wp-includes/formatting.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 36b9470e08..5c75642199 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -4202,7 +4202,7 @@ function esc_url( $url, $protocols = null, $_context = 'display' ) { return $url; } - $url = str_replace( ' ', '%20', $url ); + $url = str_replace( ' ', '%20', ltrim( $url ) ); $url = preg_replace( '|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\[\]\\x80-\\xff]|i', '', $url ); if ( '' === $url ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 5bc91186aa..c91ef5eb46 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @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.