Menus: Use `esc_url()` for the `href` value of page link attributes in `Walker_Page::start_el()`, for consistency with `Walker_Nav_Menu` and `Walker_Category`.

See #40666, #40359.
Built from https://develop.svn.wordpress.org/trunk@44958


git-svn-id: http://core.svn.wordpress.org/trunk@44789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-03-21 10:45:51 +00:00
parent bbf36b6521
commit 26a90ce462
2 changed files with 2 additions and 2 deletions

View File

@ -183,7 +183,7 @@ class Walker_Page extends Walker {
$attributes = ''; $attributes = '';
foreach ( $atts as $attr => $value ) { foreach ( $atts as $attr => $value ) {
if ( ! empty( $value ) ) { if ( ! empty( $value ) ) {
$value = esc_attr( $value ); $value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );
$attributes .= ' ' . $attr . '="' . $value . '"'; $attributes .= ' ' . $attr . '="' . $value . '"';
} }
} }

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.2-alpha-44957'; $wp_version = '5.2-alpha-44958';
/** /**
* 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.