diff --git a/inc/front/cdn.php b/inc/front/cdn.php index cac116d1ae..4944664c92 100644 --- a/inc/front/cdn.php +++ b/inc/front/cdn.php @@ -142,6 +142,7 @@ function rocket_cdn_images( $html ) { // Image path is relative, apply the host to it if ( empty( $host ) ) { $image_url = $home_url . ltrim( $image_url, '/' ); + $host = parse_url( $image_url, PHP_URL_HOST ); } // Check if the link isn't external @@ -305,4 +306,4 @@ function rocket_cdn_enqueue( $src ) { } return $src; -} \ No newline at end of file +}