Skip to content

Commit 192661a

Browse files
committed
Hotfix: correctly apply CDN on relative image path
1 parent dc6637d commit 192661a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

inc/front/cdn.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ function rocket_cdn_images( $html ) {
142142
// Image path is relative, apply the host to it
143143
if ( empty( $host ) ) {
144144
$image_url = $home_url . ltrim( $image_url, '/' );
145+
$host = parse_url( $image_url, PHP_URL_HOST );
145146
}
146147

147148
// Check if the link isn't external
@@ -305,4 +306,4 @@ function rocket_cdn_enqueue( $src ) {
305306
}
306307

307308
return $src;
308-
}
309+
}

0 commit comments

Comments
 (0)