diff --git a/projects/plugins/jetpack/changelog/fix-cdn-deprecated-error b/projects/plugins/jetpack/changelog/fix-cdn-deprecated-error new file mode 100644 index 000000000000..d9949012c9b4 --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-cdn-deprecated-error @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Cleaning PHP deprecated error notice from the log diff --git a/projects/plugins/jetpack/modules/photon-cdn.php b/projects/plugins/jetpack/modules/photon-cdn.php index 232a1c8d329f..8a72cc231fbd 100644 --- a/projects/plugins/jetpack/modules/photon-cdn.php +++ b/projects/plugins/jetpack/modules/photon-cdn.php @@ -77,6 +77,9 @@ public static function cdnize_assets() { if ( wp_startswith( $thing->src, self::CDN ) ) { continue; } + if ( ! is_string( $thing->src ) ) { + continue; + } $src = ltrim( str_replace( $site_url, '', $thing->src ), '/' ); if ( self::is_js_or_css_file( $src ) && in_array( substr( $src, 0, 9 ), array( 'wp-admin/', 'wp-includ' ), true ) ) { $wp_scripts->registered[ $handle ]->src = sprintf( self::CDN . 'c/%1$s/%2$s', $version, $src ); @@ -87,6 +90,9 @@ public static function cdnize_assets() { if ( wp_startswith( $thing->src, self::CDN ) ) { continue; } + if ( ! is_string( $thing->src ) ) { + continue; + } $src = ltrim( str_replace( $site_url, '', $thing->src ), '/' ); if ( self::is_js_or_css_file( $src ) && in_array( substr( $src, 0, 9 ), array( 'wp-admin/', 'wp-includ' ), true ) ) { $wp_styles->registered[ $handle ]->src = sprintf( self::CDN . 'c/%1$s/%2$s', $version, $src );