diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:51:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:51:22 +0000 |
commit | fc0a79914946dac00ccd51b1aacffe267de7210e (patch) | |
tree | 1403384efbfe8f8776ff60aaa40f7d535c02c822 /wp-admin/network/site-info.php | |
parent | Releasing progress-linux version 6.5.5+dfsg1-1~progress7.99u1. (diff) | |
download | wordpress-fc0a79914946dac00ccd51b1aacffe267de7210e.tar.xz wordpress-fc0a79914946dac00ccd51b1aacffe267de7210e.zip |
Merging upstream version 6.6.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wp-admin/network/site-info.php')
-rw-r--r-- | wp-admin/network/site-info.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/wp-admin/network/site-info.php b/wp-admin/network/site-info.php index defcc26..46f67cc 100644 --- a/wp-admin/network/site-info.php +++ b/wp-admin/network/site-info.php @@ -66,8 +66,14 @@ if ( isset( $_REQUEST['action'] ) && 'update-site' === $_REQUEST['action'] ) { } $blog_data['scheme'] = $update_parsed_url['scheme']; + + // Make sure to not lose the port if it was provided. $blog_data['domain'] = $update_parsed_url['host']; - $blog_data['path'] = $update_parsed_url['path']; + if ( isset( $update_parsed_url['port'] ) ) { + $blog_data['domain'] .= ':' . $update_parsed_url['port']; + } + + $blog_data['path'] = $update_parsed_url['path']; } $existing_details = get_site( $id ); @@ -88,16 +94,18 @@ if ( isset( $_REQUEST['action'] ) && 'update-site' === $_REQUEST['action'] ) { $old_home_url = trailingslashit( esc_url( get_option( 'home' ) ) ); $old_home_parsed = parse_url( $old_home_url ); + $old_home_host = $old_home_parsed['host'] . ( isset( $old_home_parsed['port'] ) ? ':' . $old_home_parsed['port'] : '' ); - if ( $old_home_parsed['host'] === $existing_details->domain && $old_home_parsed['path'] === $existing_details->path ) { + if ( $old_home_host === $existing_details->domain && $old_home_parsed['path'] === $existing_details->path ) { $new_home_url = untrailingslashit( sanitize_url( $blog_data['scheme'] . '://' . $new_details->domain . $new_details->path ) ); update_option( 'home', $new_home_url ); } $old_site_url = trailingslashit( esc_url( get_option( 'siteurl' ) ) ); $old_site_parsed = parse_url( $old_site_url ); + $old_site_host = $old_site_parsed['host'] . ( isset( $old_site_parsed['port'] ) ? ':' . $old_site_parsed['port'] : '' ); - if ( $old_site_parsed['host'] === $existing_details->domain && $old_site_parsed['path'] === $existing_details->path ) { + if ( $old_site_host === $existing_details->domain && $old_site_parsed['path'] === $existing_details->path ) { $new_site_url = untrailingslashit( sanitize_url( $blog_data['scheme'] . '://' . $new_details->domain . $new_details->path ) ); update_option( 'siteurl', $new_site_url ); } |