From f144b7df180f69da4e850b766723251c4da121c0 Mon Sep 17 00:00:00 2001 From: liugang Date: Tue, 20 Feb 2024 16:20:55 +0800 Subject: [PATCH] * framework: check the property before calling it. --- framework/control.class.php | 2 +- framework/model.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/control.class.php b/framework/control.class.php index 8c3ef500e8..003a67c19b 100644 --- a/framework/control.class.php +++ b/framework/control.class.php @@ -647,7 +647,7 @@ class control extends baseControl $moduleName = $this->app->getModuleName(); $zenClass = $moduleName . 'Zen'; - if(is_callable(array($this->{$zenClass}, $method))) return call_user_func_array(array($this->{$zenClass}, $method), $arguments); + if(isset($this->{$zenClass}) && is_callable(array($this->{$zenClass}, $method))) return call_user_func_array(array($this->{$zenClass}, $method), $arguments); $this->app->triggerError("the module {$moduleName} has no {$method} method", __FILE__, __LINE__, true); } diff --git a/framework/model.class.php b/framework/model.class.php index b01705329a..08e1e08069 100644 --- a/framework/model.class.php +++ b/framework/model.class.php @@ -334,7 +334,7 @@ class model extends baseModel $moduleName = $this->getModuleName(); $taoClass = $moduleName . 'Tao'; - if(is_callable(array($this->{$taoClass}, $method))) return call_user_func_array(array($this->{$taoClass}, $method), $arguments); + if(isset($this->{$taoClass}) && is_callable(array($this->{$taoClass}, $method))) return call_user_func_array(array($this->{$taoClass}, $method), $arguments); $this->app->triggerError("the module {$moduleName} has no {$method} method", __FILE__, __LINE__, true); }