OllieJones / sqlite-object-cache

A WordPress persistent object cache for the rest of us.
GNU General Public License v2.0
24 stars 4 forks source link

Set a default value for get_option to avoid PHP errors #1

Closed aristath closed 1 year ago

aristath commented 1 year ago

As soon as I activated the plugin I got some PHP warnings like PHP Warning: array_key_exists() expects parameter 2 to be array, bool given in /var/www/src/wp-content/plugins/sqlite-object-cache/includes/class-sqlite-object-cache.php on line 138 That's because get_option returns false if the value hasn't already been set, so the array_key_exists call fails. Adding a default value in the get_option fixes the issue.

OllieJones commented 1 year ago

Ari, thanks for this PR. I dealt with the problem.