diff --git a/projects/packages/image-cdn/changelog/fix-photon-amazon-cdn b/projects/packages/image-cdn/changelog/fix-photon-amazon-cdn new file mode 100644 index 0000000000000..d6b2aadf0439e --- /dev/null +++ b/projects/packages/image-cdn/changelog/fix-photon-amazon-cdn @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Do not serve media from Amazon CDN from Jetpack's CDN. diff --git a/projects/packages/image-cdn/src/class-image-cdn-core.php b/projects/packages/image-cdn/src/class-image-cdn-core.php index 9348576ab4737..d577eeb68dfe2 100644 --- a/projects/packages/image-cdn/src/class-image-cdn-core.php +++ b/projects/packages/image-cdn/src/class-image-cdn-core.php @@ -342,6 +342,7 @@ public static function banned_domains( $skip, $image_url ) { '/\.cdninstagram\.com$/', '/^(commons|upload)\.wikimedia\.org$/', '/\.wikipedia\.org$/', + '/^m\.media-amazon\.com$/', ); $host = wp_parse_url( $image_url, PHP_URL_HOST ); diff --git a/projects/packages/image-cdn/src/class-image-cdn.php b/projects/packages/image-cdn/src/class-image-cdn.php index d02fba3e2c8c7..9765c6a05a60f 100644 --- a/projects/packages/image-cdn/src/class-image-cdn.php +++ b/projects/packages/image-cdn/src/class-image-cdn.php @@ -12,7 +12,7 @@ */ final class Image_CDN { - const PACKAGE_VERSION = '0.4.3'; + const PACKAGE_VERSION = '0.4.4-alpha'; /** * Singleton. diff --git a/projects/packages/image-cdn/tests/php/test_class.image_cdn_core.php b/projects/packages/image-cdn/tests/php/test_class.image_cdn_core.php index d3bfb70912559..204075146cd8c 100644 --- a/projects/packages/image-cdn/tests/php/test_class.image_cdn_core.php +++ b/projects/packages/image-cdn/tests/php/test_class.image_cdn_core.php @@ -428,6 +428,10 @@ public function get_photon_domains() { true, 'https://en.wikipedia.org/wiki/File:MM10249.jpg', ), + 'Banned Amazon domain' => array( + true, + 'http://m.media-amazon.com/images/I/41YeeCMUwTL._SL300_.jpg', + ), ); } }