Skip to content

Commit 4e5150c

Browse files
committed
Hotfix: Keep the correct host value for a subdomain when multisite domain mapping is active
1 parent 0c2e65d commit 4e5150c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

inc/domain-mapping.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
function rocket_parse_url_domain_mapping( $url ) {
1111
$original_siteurl_host = parse_url( get_original_url( 'siteurl' ), PHP_URL_HOST );
1212
$domain_mapping_siteurl_host = parse_url( domain_mapping_siteurl( false ), PHP_URL_HOST );
13-
14-
$url[0] = str_replace( $original_siteurl_host, $domain_mapping_siteurl_host, $url[0] );
13+
14+
if ( false === strpos( $domain_mapping_siteurl_host, $original_siteurl_host ) ) {
15+
$url[0] = str_replace( $original_siteurl_host, $domain_mapping_siteurl_host, $url[0] );
16+
}
1517

1618
return $url;
1719
}

0 commit comments

Comments
 (0)