Make WordPress Core

Opened 5 months ago

Last modified 4 months ago

#59573 new defect (bug)

warning: trying to access array offset on value of type bool in wp-includes/media.php

Reported by: androidforlife's profile androidforlife Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.3.1
Component: Media Keywords:
Focuses: Cc:

Description (last modified by sabernhardt)

function image_get_intermediate_size($post_id, $size = 'thumbnail')
{
    $imagedata = wp_get_attachment_metadata($post_id);

    // Checking whether $imagedata and $imagedata['sizes'] are real arrays.
    if (!is_array($imagedata) || empty($imagedata['sizes']) || !is_array($imagedata['sizes'])) {
        return false;
    }

    // Checking whether $size has a valid structure.
    if (!is_array($size) || count($size) < 2) {
        return false;
    }

    $data = [];

.....

Change History (1)

#1 @sabernhardt
4 months ago

  • Component changed from General to Media
  • Description modified (diff)
  • Summary changed from warning: trying to access array offset on value of type bool in wp-incloudes/media.php to warning: trying to access array offset on value of type bool in wp-includes/media.php
Note: See TracTickets for help on using tickets.