Administration: Escape admin title on output after the `admin_title` filter runs, not before.

Props lalitpendhare, adnan.limdi, subrataemfluence, andraganescu.
Fixes #41921.
Built from https://develop.svn.wordpress.org/trunk@47474


git-svn-id: http://core.svn.wordpress.org/trunk@47261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-03-20 02:20:08 +00:00
parent ed01dbb89b
commit 2fd80efe13
3 changed files with 6 additions and 6 deletions

View File

@ -32,14 +32,14 @@ if ( empty( $current_screen ) ) {
}
get_admin_page_title();
$title = esc_html( strip_tags( $title ) );
$title = strip_tags( $title );
if ( is_network_admin() ) {
/* translators: Network admin screen title. %s: Network title. */
$admin_title = sprintf( __( 'Network Admin: %s' ), esc_html( get_network()->site_name ) );
$admin_title = sprintf( __( 'Network Admin: %s' ), get_network()->site_name );
} elseif ( is_user_admin() ) {
/* translators: User dashboard screen title. %s: Network title. */
$admin_title = sprintf( __( 'User Dashboard: %s' ), esc_html( get_network()->site_name ) );
$admin_title = sprintf( __( 'User Dashboard: %s' ), get_network()->site_name );
} else {
$admin_title = get_bloginfo( 'name' );
}
@ -71,7 +71,7 @@ wp_user_settings();
_wp_admin_html_begin();
?>
<title><?php echo $admin_title; ?></title>
<title><?php echo esc_html( $admin_title ); ?></title>
<?php
wp_enqueue_style( 'colors' );

View File

@ -150,7 +150,7 @@ $body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '
$admin_title = sprintf( $wp_customize->get_document_title_template(), __( 'Loading&hellip;' ) );
?>
<title><?php echo $admin_title; ?></title>
<title><?php echo esc_html( $admin_title ); ?></title>
<script type="text/javascript">
var ajaxurl = <?php echo wp_json_encode( admin_url( 'admin-ajax.php', 'relative' ) ); ?>,

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.5-alpha-47473';
$wp_version = '5.5-alpha-47474';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.