Browse Source

Put rmdir outside of loop

Nathaniel van Diepen 11 years ago
parent
commit
5820dac2b5
1 changed files with 5 additions and 5 deletions
  1. 5 5
      install/api.php

+ 5 - 5
install/api.php

@@ -141,11 +141,11 @@
 							if($file != '.' && $file != '..'){
 								@unlink(realpath(dirname(__FILE__)).'/'.$file);
 							}
-							if(empty(scandir(realpath(dirname(__FILE__))))){
-								@rmdir(realpath(dirname(__FILE__)));
-							}else{
-								echo "Couldn't remove install directory\n";
-							}
+						}
+						if(empty(scandir(realpath(dirname(__FILE__))))){
+							@rmdir(realpath(dirname(__FILE__)));
+						}else{
+							echo "Couldn't remove install directory\n";
 						}
 					}else{
 						die('Invalid id');