Skip to content

Commit

Permalink
fix PHP fatal error on PHP 5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAnderson684 committed Oct 24, 2018
1 parent 2334964 commit 1edb57f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions class-udm-updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 1edb57f

Please sign in to comment.