mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Media: Sanity check image meta in 'wp_image_src_get_dimensions'.
This fixes a potential illegal offset error introduced in [50134] if the `$image_meta` doesn't include a `file` key.
Props dd32.
Fixes #51865.
git-svn-id: https://develop.svn.wordpress.org/trunk@50136 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
354aad63c3
commit
ce2b61b40f
@ -1602,7 +1602,10 @@ function wp_image_src_get_dimensions( $image_src, $image_meta, $attachment_id =
|
||||
$dimensions = false;
|
||||
|
||||
// Is it a full size image?
|
||||
if ( strpos( $image_src, $image_meta['file'] ) !== false ) {
|
||||
if (
|
||||
isset( $image_meta['file'] ) &&
|
||||
strpos( $image_src, $image_meta['file'] ) !== false
|
||||
) {
|
||||
$dimensions = array(
|
||||
(int) $image_meta['width'],
|
||||
(int) $image_meta['height'],
|
||||
|
||||
Loading…
Reference in New Issue
Block a user