cloudflare / Cloudflare-WordPress

A Cloudflare plugin for WordPress
https://www.cloudflare.com/wordpress/
BSD 3-Clause "New" or "Revised" License
216 stars 83 forks source link

Cloudflare plugin causing error when deleting a post #462

Closed anhphammody closed 2 years ago

anhphammody commented 2 years ago

Confirmation

WordPress version

5.9.2

Cloudflare-WordPress version

4.8.3

PHP version

8.0.12

Expected result

No thing

Actual result

Error Details

An error of type E_ERROR was caused in line 188 of the file /www/wwwroot/domain.com/wp-content/plugins/cloudflare/src/WordPress/Hooks.php. Error message: Uncaught TypeError: array_filter(): Argument #1 ($array) must be of type array, null given in /www/wwwroot/domain.com/wp-content/plugins/cloudflare/src/WordPress/Hooks.php:188 Stack trace:

0 /www/wwwroot/domain.com/wp-content/plugins/cloudflare/src/WordPress/Hooks.php(188): array_filter()

1 /www/wwwroot/domain.com/wp-content/plugins/cloudflare/src/WordPress/Hooks.php(420): CF\WordPress\Hooks->purgeCacheByRelevantURLs()

2 /www/wwwroot/domain.com/wp-includes/class-wp-hook.php(307): CF\WordPress\Hooks->purgeCacheOnPostStatusChange()

3 /www/wwwroot/domain.com/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()

4 /www/wwwroot/domain.com/wp-includes/plugin.php(474): WP_Hook->do_action()

5 /www/wwwroot/domain.com/wp-includes/post.php(5317): do_action()

6 /www/wwwroot/domain.com/wp-includes/post.php(4577): wp_transition_post_status()

7 /www/wwwroot/domain.com/wp-includes/post.php(4789): wp_insert_post()

8 /www/wwwroot/domain.com/wp-includes/post.php(3593): wp_update_post()

9 /www/wwwroot/domain.com/wp-admin/post.php(260): wp_trash_post()

10 {main}

thrown

Steps to reproduce

  1. Trash a post from the posts list

Additional factoids

No response

References

No response