Skip to content

Commit

Permalink
Hotfix: correctly apply CDN on relative image path
Browse files Browse the repository at this point in the history
  • Loading branch information
remyperona committed Feb 22, 2017
1 parent dc6637d commit 192661a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion inc/front/cdn.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -305,4 +306,4 @@ function rocket_cdn_enqueue( $src ) {
}

return $src;
}
}

0 comments on commit 192661a

Please sign in to comment.