From cf9ad76deceed41f0c68bd8f28232e6f1dd57e99 Mon Sep 17 00:00:00 2001 From: ant1sg Date: Mon, 9 Mar 2026 00:15:44 +0100 Subject: [PATCH 1/2] Oembed : Check whether wp_get_attachment_image_src returns an array There was no check whether this method returned an array or anything else before populating the url, height & width and therefore triggering a php warning in 8.5 Fixes #64742. --- src/wp-includes/embed.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/embed.php b/src/wp-includes/embed.php index dd21b6cf22fe1..af0d3aa411b7c 100644 --- a/src/wp-includes/embed.php +++ b/src/wp-includes/embed.php @@ -739,10 +739,12 @@ function get_oembed_response_data_rich( $data, $post, $width, $height ) { } if ( $thumbnail_id ) { - list( $thumbnail_url, $thumbnail_width, $thumbnail_height ) = wp_get_attachment_image_src( $thumbnail_id, array( $width, 0 ) ); - $data['thumbnail_url'] = $thumbnail_url; - $data['thumbnail_width'] = $thumbnail_width; - $data['thumbnail_height'] = $thumbnail_height; + $image_src = wp_get_attachment_image_src( $thumbnail_id, array( $width, 0 ) ); + if ( is_array( $image_src ) ) { + $data['thumbnail_url'] =(string) $image_src[0]; + $data['thumbnail_width'] = (int) $image_src[1]; + $data['thumbnail_height'] = (int) $image_src[2]; + } } return $data; From 7f20364b2f257b8fd8bb58812865f69acc18af05 Mon Sep 17 00:00:00 2001 From: ant1sg Date: Mon, 9 Mar 2026 22:08:36 +0100 Subject: [PATCH 2/2] Oembed : Check whether wp_get_attachment_image_src returns an array Fixed a typo in my former commit Fixes #64742. --- src/wp-includes/embed.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/embed.php b/src/wp-includes/embed.php index af0d3aa411b7c..6e10808b9b08c 100644 --- a/src/wp-includes/embed.php +++ b/src/wp-includes/embed.php @@ -741,7 +741,7 @@ function get_oembed_response_data_rich( $data, $post, $width, $height ) { if ( $thumbnail_id ) { $image_src = wp_get_attachment_image_src( $thumbnail_id, array( $width, 0 ) ); if ( is_array( $image_src ) ) { - $data['thumbnail_url'] =(string) $image_src[0]; + $data['thumbnail_url'] = (string) $image_src[0]; $data['thumbnail_width'] = (int) $image_src[1]; $data['thumbnail_height'] = (int) $image_src[2]; }