Browse Source

Check if given import-path is a dir

Tobias Reich 9 years ago
parent
commit
6c142f8570
1 changed files with 5 additions and 0 deletions
  1. 5 0
      php/modules/Import.php

+ 5 - 0
php/modules/Import.php

@@ -119,6 +119,11 @@ class Import extends Module {
 
 		if (!isset($path)) $path = LYCHEE_UPLOADS_IMPORT;
 
+		if (is_dir($path)===false) {
+			Log::error($database, __METHOD__, __LINE__, 'Given path is not a directory (' . $path . ')');
+			return 'Error: Given path is not a directory!';
+		}
+
 		if ($useTemp===true) {
 			$path = Import::move($database, $path);
 			if ($path===false) {