[wp-trac] [WordPress Trac] #54943: image_get_intermediate_size(): size data is a bool, not an array throws notice / warning (was: PHP Warnings in image_get_intermediate_size() on PHP >= 8)
WordPress Trac
noreply at wordpress.org
Mon Aug 7 19:20:26 UTC 2023
#54943: image_get_intermediate_size(): size data is a bool, not an array throws
notice / warning
-------------------------------------------------+-------------------------
Reporter: fhwebdesign | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting
| Review
Component: Media | Version: 5.9
Severity: normal | Resolution:
Keywords: has-patch reporter-feedback needs- | Focuses:
testing-info needs-unit-tests changes- |
requested |
-------------------------------------------------+-------------------------
Changes (by hellofromTonya):
* keywords:
php80 has-patch reporter-feedback needs-testing-info needs-unit-tests
changes-requested
=>
has-patch reporter-feedback needs-testing-info needs-unit-tests
changes-requested
Old description:
> While testing my website on PHP8.0 (in my example opening the blog page),
> I noticed the following two warnings in the error log:
>
> {{{
> [27-Jan-2022 08:56:34] WARNING: [pool xxx] child 1031078 said into
> stderr: "PHP message: PHP Warning: Trying to access array offset on
> value of type bool in /var/www/xxx/wp-includes/media.php on line 779"
> [27-Jan-2022 08:56:34] WARNING: [pool xxx] child 1031078 said into
> stderr: "PHP message: PHP Warning: Trying to access array offset on
> value of type bool in /var/www/xxx/wp-includes/media.php on line 785"
> }}}
>
> I also noticed with a fresh install of wordpress. PHP 7.4 works great.
New description:
While testing my website on PHP 8.0 (in my example opening the blog page),
I noticed the following two warnings in the error log:
{{{
[27-Jan-2022 08:56:34] WARNING: [pool xxx] child 1031078 said into stderr:
"PHP message: PHP Warning: Trying to access array offset on value of type
bool in /var/www/xxx/wp-includes/media.php on line 779"
[27-Jan-2022 08:56:34] WARNING: [pool xxx] child 1031078 said into stderr:
"PHP message: PHP Warning: Trying to access array offset on value of type
bool in /var/www/xxx/wp-includes/media.php on line 785"
}}}
PHP 7.4 throws a Notice.
I also noticed with a fresh install of wordpress.
--
Comment:
I've reworded the Summary to better reflect the issue being reported,
while focusing it on where the error is being thrown (though likely not
the root cause).
I've also removed the `php80` keyword. Why? The reported issue is not only
related to PHP 8.0. A Notice is thrown on PHP 7. Rather, the issue is: for
some reason, there's no size data for one or more attachments.
See the error in action on different PHP versions: https://3v4l.org/FBhtS
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54943#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list