* Fix error cann't use the fetch function to call an encrypted extended control method - fix bug #34614, 34615, 34627.

This commit is contained in:
liugang
2023-04-26 00:39:07 +00:00
parent 8b02177ec7
commit 4981fcb9dd
+3 -9
View File
@@ -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);
/**
* 设置调用的类名。