SIGN IN SIGN UP

Media: Guard against `false` return values from `wp_get_attachment_image_src()` and `wp_getimagesize()`.

* Add `is_array()` checks before accessing return values from `wp_get_attachment_image_src()` in `get_oembed_response_data_rich()`, `wp_playlist_shortcode()`, and `wp_prepare_attachment_for_js()`. 
* Guard `wp_getimagesize()` calls within `wp_get_attachment_image_src()` itself.
* Ensure `wp_get_attachment_image_src()` always returns the expected `array{0: string, 1: int, 2: int, 3: bool}` type or `false` by normalizing the filter result with explicit type casting and default values.
* Add `@phpstan-return` annotations to both `wp_get_attachment_image_src()` and `wp_getimagesize()` for the specific array shapes.

Developed in https://github.com/WordPress/wordpress-develop/pull/11073

Props hbhalodia, westonruter, mukesh27, edent, ozgursar, roshniahuja14.
Fixes #64742.


git-svn-id: https://develop.svn.wordpress.org/trunk@62176 602fd350-edb4-49c9-b593-d223f7449a82
W
Weston Ruter committed
c2f2558aaa89531854b9e68aab96edeeeddd1958
Parent: 3b3b726