[wp-trac] [WordPress Trac] #57813: wp_get_missing_image_subsizes() can give error if image_meta exists, but not height/width
WordPress Trac
noreply at wordpress.org
Sat Oct 28 15:24:10 UTC 2023
#57813: wp_get_missing_image_subsizes() can give error if image_meta exists, but
not height/width
--------------------------+------------------------------
Reporter: donbowman | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 6.1.1
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+------------------------------
Comment (by donbowman):
This is another spot with the same issue, assuming width/height exist on
svg.
{{{
--- /app/wp-includes/media.php.orig 2023-10-28 15:19:04.671902110
+0000
+++ /app/wp-includes/media.php 2023-10-28 15:19:35.784547473 +0000
@@ -1642,6 +1642,8 @@
// Is it a full size image?
if (
isset( $image_meta['file'] ) &&
+ array_key_exists('width', $image_meta['file'] &&
+ array_key_exists('height', $image_meta['file'] &&
str_contains( $image_src, wp_basename( $image_meta['file']
) )
) {
$dimensions = array(
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57813#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list