From 1edb57ff97273be0f71dab346628958c4c28c011 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 24 Oct 2018 16:00:01 +0000 Subject: [PATCH] fix PHP fatal error on PHP 5.2 --- class-udm-updater.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/class-udm-updater.php b/class-udm-updater.php index 713f113..ec1e9c5 100644 --- a/class-udm-updater.php +++ b/class-udm-updater.php @@ -204,9 +204,10 @@ public function udmupdater_ajax() { // Hopefully take off the 'Checker'. The setUpdate() call below wants a compatible version. $plugin_update_class = substr($checker_class, 0, strlen($checker_class)-7); - if (class_exists($plugin_update_class) && !empty($this->plug_updatechecker)) { + if (class_exists($plugin_update_class) && is_callable(array($plugin_update_class, 'fromObject')) && !empty($this->plug_updatechecker)) { - $plugin_update = $plugin_update_class::fromObject($plugin_info); + // $plugin_update_class::fromObject() is invalid syntax on PHP 5.2 + $plugin_update = call_user_func(array($plugin_update_class, 'fromObject'), $plugin_info); $update_checker = $this->plug_updatechecker;