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.

git-svn-id: https://develop.svn.wordpress.org/trunk@44958 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2019-03-21 10:44:21 +00:00
parent ae0605b323
commit 64681631f1
1 changed files with 1 additions and 1 deletions

View File

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