Skip to content

Commit c870e3c

Browse files
committed
API Sites: Fix api version url re-write to handle cross site links
Closes gh-318
1 parent 4052acc commit c870e3c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mu-plugins/api-sites/rewrite-old-api-links.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
list( , $subsite ) = explode( '/', JQUERY_LIVE_SITE, 2 );
1414

1515
$callback = function( $content ) use ( $subsite ) {
16-
$content = preg_replace( '~(href|src)=(["\'])/(?!\d+\.\d+/)~', '$1=$2/' . $subsite . '/', $content );
16+
$content = preg_replace( '~(href|src)=(["\'])/(?!\d+\.\d+/)(?=/'.JQUERY_LIVE_DOMAIN.')~', '$1=$2/' . $subsite . '/', $content );
1717
return $content;
1818
};
1919

0 commit comments

Comments
 (0)