Make WordPress Core

Opened 5 weeks ago

Last modified 5 weeks ago

#64600 new defect (bug)

[E_WARNING] Undefined array key "full" in wp-includes/media.php on line 4678

Reported by: artz91's profile ArtZ91 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version: 6.9.1
Component: Media Keywords: has-patch
Focuses: Cc:

Description

Actual code at 4678:
} elseif ( $meta['sizes']['full']['file'] ) {

Possible fix:
} elseif ( ! empty($meta['sizes']['full']['file'] ) ) {

Stack trace:

Array
(
    [0] => Array
        (
            [file] => /wp-includes/media.php
            [line] => 4678
            [function] => {closure}
        )

    [1] => Array
        (
            [function] => wp_prepare_attachment_for_js
        )

    [2] => Array
        (
            [file] => /wp-admin/includes/ajax-actions.php
            [line] => 3084
            [function] => array_map
        )

    [3] => Array
        (
            [file] => /wp-includes/class-wp-hook.php
            [line] => 341
            [function] => wp_ajax_query_attachments
        )

    [4] => Array
        (
            [file] => /wp-includes/class-wp-hook.php
            [line] => 365
            [function] => apply_filters
            [class] => WP_Hook
            [type] => ->
        )

    [5] => Array
        (
            [file] => /wp-includes/plugin.php
            [line] => 522
            [function] => do_action
            [class] => WP_Hook
            [type] => ->
        )

    [6] => Array
        (
            [file] => /wp-admin/admin-ajax.php
            [line] => 192
            [function] => do_action
        )

)

Attachments (1)

64600-fixed-undefined-array-key-issue.patch (539 bytes) - added by iflairwebtechnologies 5 weeks ago.
Fixed key issue

Download all attachments as: .zip

Change History (3)

#1 @vishalkakadiya
5 weeks ago

@ArtZ91 Thank you for opening a ticket.

Can you provide steps to reproduce this warning?

Last edited 5 weeks ago by vishalkakadiya (previous) (diff)

#2 @iflairwebtechnologies
5 weeks ago

  • Keywords has-patch added

Media: prevent undefined array key notice for full size image

Note: See TracTickets for help on using tickets.