Skip to content

Commit d843c5f

Browse files
authored
Merge pull request #379 from wp-media/fix/378-cdn-svg
Fixes #378
2 parents 03e44ab + 5f013e6 commit d843c5f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

inc/front/cdn.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ function rocket_cdn_images( $html ) {
136136
list( $host, $path, $scheme, $query ) = get_rocket_parse_url( $image_url );
137137
$path = trim( $path );
138138

139-
if ( empty( $path ) || '{href}' === $path ) {
139+
if ( empty( $path ) || '{href}' === $path || '+markerData[i].thumbnail+' === $path ) {
140140
continue;
141141
}
142142

@@ -211,7 +211,12 @@ function rocket_cdn_inline_styles( $html ) {
211211
if ( ( bool ) $matches ) {
212212
$i = 0;
213213
foreach( $matches[1] as $url ) {
214-
$url = trim( $url, " \t\n\r\0\x0B\"'"#039;" );
214+
$url = str_replace( array( ' ', '\t', '\n', '\r', '\0', '\x0B', '"', "'", '"', '#039;' ), '', $url );
215+
216+
if ( '#' === substr( $url, 0, 1 ) ) {
217+
continue;
218+
}
219+
215220
$url = get_rocket_cdn_url( $url, $zone );
216221
$property = str_replace( $matches[1][$i], $url, $matches[0][$i] );
217222
$html = str_replace( $matches[0][$i], $property, $html );

0 commit comments

Comments
 (0)