We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c5308d4 commit 96e424eCopy full SHA for 96e424e
1 file changed
src/wp-admin/includes/misc.php
@@ -1406,7 +1406,11 @@ function wp_admin_canonical_url() {
1406
}
1407
1408
// Ensure we're using an absolute URL.
1409
- $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
+ // Build the canonical URL using the configured admin URL to avoid issues
1410
+ // with reverse proxies that expose a different host via HTTP_HOST.
1411
+ $path = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH );
1412
+ $query = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_QUERY );
1413
+ $current_url = admin_url( ltrim( $path, '/' ) . ( $query ? '?' . $query : '' ) );
1414
$filtered_url = remove_query_arg( $removable_query_args, $current_url );
1415
1416
/**
0 commit comments