Applied patch for folders with special characters

This commit is contained in:
Marc Alexander
2011-03-20 00:48:57 +01:00
parent b9c0d7b9c8
commit 491e3f35ef

View File

@@ -917,9 +917,11 @@ class acp_portal
$compress->extract($mod_dir . '_tmp/'); $compress->extract($mod_dir . '_tmp/');
$compress->close(); $compress->close();
$folder_contents = scandir($mod_dir . '_tmp/', 1); // This ensures dir is at index 0 $folder_contents = scandir($mod_dir . '_tmp/', 1); // This ensures dir is at index 0
$cut_array = array('.', '..');
$folder_contents = array_diff($folder_contents, $cut_array);
// We need to check if there's a main directory inside the temp MOD directory // We need to check if there's a main directory inside the temp MOD directory
if (sizeof($folder_contents) == 3) if (sizeof($folder_contents) == 1)
{ {
// We need to move that directory then // We need to move that directory then
$this->directory_move($mod_dir . '_tmp/' . $folder_contents[0], $upload_path . '/' . $folder_contents[0]); $this->directory_move($mod_dir . '_tmp/' . $folder_contents[0], $upload_path . '/' . $folder_contents[0]);
@@ -939,7 +941,6 @@ class acp_portal
// Now we need to get the files inside the folders // Now we need to get the files inside the folders
$folder_contents = scandir($mod_dir); $folder_contents = scandir($mod_dir);
$cut_array = array('.', '..');
$folder_contents = array_diff($folder_contents, $cut_array); $folder_contents = array_diff($folder_contents, $cut_array);