|
@@ -107,10 +107,10 @@ discard block |
|
|
block discarded – undo |
|
107
|
107
|
} |
|
108
|
108
|
} |
|
109
|
109
|
if ( ! empty( $this->options['external_cdn_link'] ) ) { |
|
110
|
|
- //Modify the CDN URL, we won't need any parts after the host. |
|
111
|
|
- $parsed_cdn_url = parse_url( $this->options['external_cdn_link'] ); |
|
112
|
|
- $parsed_url['path'] = str_replace( $parsed_cdn_url['path'], "", $parsed_url['path'] ); |
|
113
|
|
- } |
|
|
110
|
+ //Modify the CDN URL, we won't need any parts after the host. |
|
|
111
|
+ $parsed_cdn_url = parse_url( $this->options['external_cdn_link'] ); |
|
|
112
|
+ $parsed_url['path'] = str_replace( $parsed_cdn_url['path'], "", $parsed_url['path'] ); |
|
|
113
|
+ } |
|
114
|
114
|
|
|
115
|
115
|
$url = http_build_url( $parsed_url ); |
|
116
|
116
|
|
|
@@ -200,7 +200,7 @@ discard block |
|
|
block discarded – undo |
|
200
|
200
|
* @return string |
|
201
|
201
|
*/ |
|
202
|
202
|
public function replace_images_in_content( $content ) { |
|
203
|
|
- // Added null to apply filters wp_get_attachment_url to improve compatibility with https://en-gb.wordpress.org/plugins/amazon-s3-and-cloudfront/ - does not break wordpress if the plugin isn't present. |
|
|
203
|
+ // Added null to apply filters wp_get_attachment_url to improve compatibility with https://en-gb.wordpress.org/plugins/amazon-s3-and-cloudfront/ - does not break wordpress if the plugin isn't present. |
|
204
|
204
|
if ( ! empty ( $this->options['cdn_link'] ) ) { |
|
205
|
205
|
if ( preg_match_all( '/<img\s[^>]*src=([\"\']??)([^\" >]*?)\1[^>]*>/iU', $content, $matches ) ) { |
|
206
|
206
|
foreach ( $matches[2] as $image_src ) { |
Please login to merge, or discard this patch.