summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/functions.photon.php')
-rw-r--r--plugins/jetpack/functions.photon.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/plugins/jetpack/functions.photon.php b/plugins/jetpack/functions.photon.php
index 3090e5da..015d713e 100644
--- a/plugins/jetpack/functions.photon.php
+++ b/plugins/jetpack/functions.photon.php
@@ -68,14 +68,16 @@ function jetpack_photon_url( $image_url, $args = array(), $scheme = null ) {
*/
$args = apply_filters( 'jetpack_photon_pre_args', $args, $image_url, $scheme );
- if ( empty( $image_url ) )
+ if ( empty( $image_url ) ) {
return $image_url;
+ }
$image_url_parts = @jetpack_photon_parse_url( $image_url );
// Unable to parse
- if ( ! is_array( $image_url_parts ) || empty( $image_url_parts['host'] ) || empty( $image_url_parts['path'] ) )
+ if ( ! is_array( $image_url_parts ) || empty( $image_url_parts['host'] ) || empty( $image_url_parts['path'] ) ) {
return $image_url;
+ }
if ( is_array( $args ) ){
// Convert values that are arrays into strings
@@ -133,8 +135,9 @@ function jetpack_photon_url( $image_url, $args = array(), $scheme = null ) {
// However some source images are served via PHP so check the no-query-string extension.
// For future proofing, this is a blacklist of common issues rather than a whitelist.
$extension = pathinfo( $image_url_parts['path'], PATHINFO_EXTENSION );
- if ( empty( $extension ) || in_array( $extension, array( 'php', 'ashx' ) ) )
+ if ( empty( $extension ) || in_array( $extension, array( 'php', 'ashx' ) ) ) {
return $image_url;
+ }
}
$image_host_path = $image_url_parts['host'] . $image_url_parts['path'];
@@ -280,7 +283,10 @@ function jetpack_photon_banned_domains( $skip, $image_url ) {
'/^chart\.googleapis\.com$/',
'/^chart\.apis\.google\.com$/',
'/^graph\.facebook\.com$/',
- '/\.fbcdn\.net$/'
+ '/\.fbcdn\.net$/',
+ '/\.paypalobjects\.com$/',
+ '/\.dropbox\.com$/',
+ '/\.cdninstagram\.com$/',
);
$host = jetpack_photon_parse_url( $image_url, PHP_URL_HOST );