* Fix bug#34221, uninstall error when only one extension.
This commit is contained in:
@@ -432,7 +432,7 @@ class extensionModel extends model
|
||||
foreach($paths as $path)
|
||||
{
|
||||
if($path == 'db' or $path == 'doc' or $path == 'hook') continue;
|
||||
$path = $appRoot . $path;
|
||||
$path = rtrim($appRoot . $path, '/');
|
||||
if(is_dir($path))
|
||||
{
|
||||
if(!is_writable($path))
|
||||
@@ -456,7 +456,7 @@ class extensionModel extends model
|
||||
$checkResult->errors .= sprintf($this->lang->extension->errorTargetPathNotExists, $path) . '<br />';
|
||||
$checkResult->mkdirCommands .= "sudo mkdir -p $path<br />";
|
||||
}
|
||||
$checkResult->dirs2Created[] = $path;
|
||||
if(file_exists($path) and realpath($path) != realpath($appRoot . 'module/extension') . 'ext') $checkResult->dirs2Created[] = $path;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -620,7 +620,7 @@ class extensionModel extends model
|
||||
rsort($dirs); // remove from the lower level directory.
|
||||
foreach($dirs as $dir)
|
||||
{
|
||||
$path = $appRoot . $dir;
|
||||
$path = rtrim($appRoot . $dir, '/');
|
||||
if(!is_dir($path)) continue;
|
||||
|
||||
$parentDir = mb_substr($path, 0, strripos($path, '/'));
|
||||
@@ -628,7 +628,7 @@ class extensionModel extends model
|
||||
{
|
||||
$commandTips[] = PHP_OS == 'Linux' ? "sudo rm -fr $appRoot$dir" : "rmdir $appRoot$dir /s /q";
|
||||
}
|
||||
elseif(!rmdir($appRoot . $dir))
|
||||
elseif(!rmdir($path))
|
||||
{
|
||||
$commandTips[] = PHP_OS == 'Linux' ? "sudo rm -fr $appRoot$dir" : "rmdir $appRoot$dir /s /q";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user