PHP 7.2 Warning in addons.api.php
-
I got this warning after upgrading to PHP 7.2:
PHP Warning: count(): Parameter must be an array or an object that implements Countable in /wp-content/plugins/iwp-client/addons.api.php
Plugin Version: 1.6.8.1
See also:
https://wiki.php.net/rfc/counting_non_countablesFix (backwards compatible):
diff -ur iwp-client-23/addons.api.php iwp-client-24/addons.api.php --- iwp-client-23/addons.api.php 2017-12-15 10:54:51.532245753 +0100 +++ iwp-client-24/addons.api.php 2017-12-15 11:08:06.676780082 +0100 @@ -37,7 +37,7 @@ function iwp_mmb_function_exists($callback) { global $iwp_core; - if (count($callback) === 2) { + if (is_array($callback) && count($callback) === 2) { if (!method_exists($callback[0], $callback[1])) wp_die($iwp_core->iwp_dashboard_widget('Information', '', '<p>Class ' . get_class($callback[0]) . ' does not contain <b>"' . $callback[1] . '"</b> function</p>', '', '50%')); } else {
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘PHP 7.2 Warning in addons.api.php’ is closed to new replies.