Upgrade/Install: Add port number to target origin when decrementing update counts.

This ensures that the update counter bubble in the admin menu is properly decreased after a successful plugin or theme update from within the update iframe when the site uses a non-standard port number.

Follow-up to [27280], [29357].

Props TobiasBg.
Fixes #59987.
Built from https://develop.svn.wordpress.org/trunk@57148


git-svn-id: http://core.svn.wordpress.org/trunk@56659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2023-12-01 01:35:28 +00:00
parent ea6ccb240c
commit db7cb1dea2
2 changed files with 9 additions and 2 deletions

View File

@ -240,7 +240,14 @@ class WP_Upgrader_Skin {
if ( defined( 'IFRAME_REQUEST' ) ) {
echo '<script type="text/javascript">
if ( window.postMessage && JSON ) {
window.parent.postMessage( JSON.stringify( { action: "decrementUpdateCount", upgradeType: "' . $type . '" } ), window.location.protocol + "//" + window.location.hostname );
window.parent.postMessage(
JSON.stringify( {
action: "decrementUpdateCount",
upgradeType: "' . $type . '"
} ),
window.location.protocol + "//" + window.location.hostname
+ ( "" !== window.location.port ? ":" + window.location.port : "" )
);
}
</script>';
} else {

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.5-alpha-57147';
$wp_version = '6.5-alpha-57148';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.