Themes: Properly escape `home_url()` when changing and updating themes.

Props obayedmamur, hurayraiit, costdev, shraboni, msnewas.
Fixes #56145.
Built from https://develop.svn.wordpress.org/trunk@53677


git-svn-id: http://core.svn.wordpress.org/trunk@53236 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2022-07-06 19:46:10 +00:00
parent 7f43cc5d3a
commit b5a14f47bb
2 changed files with 3 additions and 3 deletions

View File

@ -266,11 +266,11 @@ if ( ! validate_current_theme() || isset( $_GET['broken'] ) ) {
} elseif ( isset( $_GET['activated'] ) ) { } elseif ( isset( $_GET['activated'] ) ) {
if ( isset( $_GET['previewed'] ) ) { if ( isset( $_GET['previewed'] ) ) {
?> ?>
<div id="message2" class="updated notice is-dismissible"><p><?php _e( 'Settings saved and theme activated.' ); ?> <a href="<?php echo home_url( '/' ); ?>"><?php _e( 'Visit site' ); ?></a></p></div> <div id="message2" class="updated notice is-dismissible"><p><?php _e( 'Settings saved and theme activated.' ); ?> <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php _e( 'Visit site' ); ?></a></p></div>
<?php <?php
} else { } else {
?> ?>
<div id="message2" class="updated notice is-dismissible"><p><?php _e( 'New theme activated.' ); ?> <a href="<?php echo home_url( '/' ); ?>"><?php _e( 'Visit site' ); ?></a></p></div> <div id="message2" class="updated notice is-dismissible"><p><?php _e( 'New theme activated.' ); ?> <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php _e( 'Visit site' ); ?></a></p></div>
<?php <?php
} }
} elseif ( isset( $_GET['deleted'] ) ) { } elseif ( isset( $_GET['deleted'] ) ) {

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.1-alpha-53676'; $wp_version = '6.1-alpha-53677';
/** /**
* 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.