Make WordPress Core

Opened 6 days ago

Last modified 6 days ago

#64742 new defect (bug)

PHP 8.5: Incorrect array access in `wp_get_attachment_image_src`

Reported by: edent's profile edent Owned by:
Milestone: 7.0 Priority: normal
Severity: minor Version: 4.4
Component: General Keywords: good-first-bug has-patch
Focuses: php-compatibility Cc:

Description

Similar to #64295 and #63977

Warning at /wp-json/oembed/1.0/embed?url=https%3A%2F%2Fshkspr.mobi%2Fblog%2Fabout%2F&format=xml: [2] Cannot use bool as array in /wp-includes/embed.php on line 742

From https://github.com/WordPress/wordpress-develop/blob/f041be2a79eb9694217d716da3bf6d53f63a2173/src/wp-includes/embed.php#L742 :

function get_oembed_response_data_rich( $data, $post, $width, $height ) {
   […]
   list( $thumbnail_url, $thumbnail_width, $thumbnail_height ) = wp_get_attachment_image_src( $thumbnail_id, array( $width, 0 ) );

wp_get_attachment_image_src() returns array|false - but this only expects an array.

Change History (2)

#1 @westonruter
6 days ago

  • Keywords good-first-bug added
  • Milestone changed from Awaiting Review to 7.0
  • Version changed from 6.9.1 to 4.4

This ticket was mentioned in PR #11073 on WordPress/wordpress-develop by @hbhalodia.


6 days ago
#2

  • Keywords has-patch added

Trac ticket: https://core.trac.wordpress.org/ticket/64742

## Use of AI Tools

  • NA
Note: See TracTickets for help on using tickets.