This commit is contained in:
wangyidong
2016-12-30 10:32:10 +08:00
parent 17ccbaa543
commit 6e374fbd13
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -67,6 +67,7 @@ class zfile
*/
public function removeDir($dir)
{
if(empty($dir)) return true;
$dir = realpath($dir) . '/';
if($dir == '/') return false;
+1 -1
View File
@@ -674,7 +674,7 @@ class extensionModel extends model
/* Remove the extracted files. */
$extractedDir = realpath("ext/$extension");
if($extractedDir != '/' and !$this->classFile->removeDir($extractedDir))
if($extractedDir and $extractedDir != '/' and !$this->classFile->removeDir($extractedDir))
{
$removeCommands[] = PHP_OS == 'Linux' ? "rm -fr $extractedDir" : "rmdir $extractedDir /s";
}