From 4981fcb9dd2f5167cdb8f8301d88898f464f7361 Mon Sep 17 00:00:00 2001 From: liugang Date: Wed, 26 Apr 2023 00:39:07 +0000 Subject: [PATCH] * Fix error cann't use the fetch function to call an encrypted extended control method - fix bug #34614, 34615, 34627. --- framework/base/control.class.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/framework/base/control.class.php b/framework/base/control.class.php index 25dc9fc83d..9dd6011a00 100644 --- a/framework/base/control.class.php +++ b/framework/base/control.class.php @@ -799,7 +799,6 @@ class baseControl $moduleControlFile = $modulePath . 'control.php'; $actionExtPath = $this->app->getModuleExtPath($appName, $moduleName, 'control'); $file2Included = $moduleControlFile; - $classNameToFetch = $moduleName; if(!empty($actionExtPath)) { @@ -845,9 +844,6 @@ class baseControl $siteActionExtFile = $actionExtPath['site'] . strtolower($methodName) . '.php'; $file2Included = file_exists($siteActionExtFile) ? $siteActionExtFile : $file2Included; } - - /* If class name is my{$moduleName} then set classNameToFetch for include this file. */ - if(strpos($file2Included, DS . 'ext' . DS) !== false and stripos(file_get_contents($file2Included), "class my{$moduleName} extends $moduleName") !== false) $classNameToFetch = "my{$moduleName}"; } /** @@ -855,11 +851,9 @@ class baseControl * Load the control file. */ if(!is_file($file2Included)) $this->app->triggerError("The control file $file2Included not found", __FILE__, __LINE__, $exit = true); - if(!class_exists($classNameToFetch)) - { - chdir(dirname($file2Included)); - helper::import($file2Included); - } + + chdir(dirname($file2Included)); + helper::import($file2Included); /** * 设置调用的类名。