Etemplate - avoid warning from method_exists if method is a callable

This commit is contained in:
nathangray 2019-07-11 11:25:30 -06:00
parent 5a1ce9c706
commit 6f7c939d8b
3 changed files with 3 additions and 3 deletions

View File

@ -534,7 +534,7 @@ class Widget
//error_log(__METHOD__."('$method_name', ".array2string($params).', '.array2string($respect_disabled).") $this disabled='{$this->attrs['disabled']}'=".array2string($disabled).": NOT running");
return;
}
if (method_exists($this, $method_name))
if (is_string($method_name) && method_exists($this, $method_name))
{
// Some parameter checking to avoid fatal errors
$call = true;

View File

@ -60,7 +60,7 @@ class Box extends Etemplate\Widget
//error_log(__METHOD__."('$method_name', ".array2string($params).', '.array2string($respect_disabled).") $this disabled='{$this->attrs['disabled']}'=".array2string($disabled).": NOT running");
return;
}
if (method_exists($this, $method_name))
if (is_string($method_name) && method_exists($this, $method_name))
{
call_user_func_array(array($this, $method_name), $params);
}

View File

@ -95,7 +95,7 @@ class Grid extends Box
$expand['cname'] = $cname;
}
if (method_exists($this, $method_name))
if (is_string($method_name) && method_exists($this, $method_name))
{
call_user_func_array(array($this, $method_name), $params);
}