Skip to content

Commit

Permalink
Photon: do not serve Amazon images from our CDN. (#38682)
Browse files Browse the repository at this point in the history
Internal reference: p1722583835923719-slack-CBG1CP4EN
  • Loading branch information
jeherve authored Aug 2, 2024
1 parent 94fb8a4 commit a2a9a9a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions projects/packages/image-cdn/changelog/fix-photon-amazon-cdn
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Do not serve media from Amazon CDN from Jetpack's CDN.
1 change: 1 addition & 0 deletions projects/packages/image-cdn/src/class-image-cdn-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion projects/packages/image-cdn/src/class-image-cdn.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
final class Image_CDN {

const PACKAGE_VERSION = '0.4.3';
const PACKAGE_VERSION = '0.4.4-alpha';

/**
* Singleton.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
),
);
}
}

0 comments on commit a2a9a9a

Please sign in to comment.