Skip to content

Conversation

@m-hefti
Copy link
Contributor

@m-hefti m-hefti commented Apr 3, 2022

While deleting a media, you might get an error about classes/class.attachments.search.php:64 count() expecting an array and getting a null value.
The $params['fields'] var might be an array or a null value (by default). If null, the count() function in the for loop (line 65) returns an error. Adding the if statement (line 64) resolves the problem.

The $params['fields'] var might be an array or a null value (by default). If null, the count() function in the for loop (line 65) returns an error. Adding the if statement (line 64) resolves the problem.
@didwedo
Copy link

didwedo commented Apr 27, 2022

Thanks for the correction, it's greatly appreciated.

@angryaxi
Copy link

angryaxi commented Nov 22, 2022

This should be merged. This fatal error happens on PHP version 8.0 and up.

As PHP 7.4 security updates stop in 6 days (28 Nov 2022), and many hosting providers have already moved sites to use PHP 8 it would be of utmost priority to publish a new version of this plugin to the WP plugin directory with this fix included.

This pull request fixes #193

@stevensjn
Copy link

Would love to help keep this plugin alive here, and on wordpress.org.

@jchristopher jchristopher merged commit c7ad3b6 into jchristopher:master Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants