← All changes
|
jetpack_vendor/automattic/jetpack-post-media/src/class-images.php
+5
-2
16.2
→
16.3
View file →
| @@ -282,8 +282,11 @@ | ||
| 282 | 282 | |
| 283 | 283 | $permalink = get_permalink( $post_id ); |
| 284 | 284 | |
| 285 | 285 | foreach ( $post_images as $post_image ) { |
| 286 | + if ( ! $post_image instanceof \WP_Post ) { | |
| 287 | + continue; | |
| 288 | + } | |
| 286 | 289 | $current_image = self::get_attachment_data( $post_image->ID, $permalink, $width, $height ); |
| 287 | 290 | if ( false !== $current_image ) { |
| 288 | 291 | $images[] = $current_image; |
| 289 | 292 | } |
| @@ -851,9 +854,9 @@ | ||
| 851 | 854 | $media = self::get_images( $post_id, $args ); |
| 852 | 855 | |
| 853 | 856 | if ( is_array( $media ) ) { |
| 854 | 857 | foreach ( $media as $item ) { |
| 855 | - if ( 'image' === $item['type'] ) { | |
| 858 | + if ( is_array( $item ) && isset( $item['type'] ) && 'image' === $item['type'] ) { | |
| 856 | 859 | $image = $item; |
| 857 | 860 | break; |
| 858 | 861 | } |
| 859 | 862 | } |
| @@ -1117,9 +1120,9 @@ | ||
| 1117 | 1120 | if ( empty( $meta ) ) { |
| 1118 | 1121 | return false; |
| 1119 | 1122 | } |
| 1120 | 1123 | |
| 1121 | - if ( ! empty( $meta['videopress'] ) ) { | |
| 1124 | + if ( isset( $meta['videopress']['poster'] ) && isset( $meta['videopress']['width'] ) && isset( $meta['videopress']['height'] ) ) { | |
| 1122 | 1125 | // Use poster image for VideoPress videos. |
| 1123 | 1126 | $url = $meta['videopress']['poster']; |
| 1124 | 1127 | $meta_width = $meta['videopress']['width']; |
| 1125 | 1128 | $meta_height = $meta['videopress']['height']; |