Browse Source

Merge pull request #156 from djdallmann/v2.5

Added support for filenames with spaces by using escapeshellarg() to eva...
Tobias Reich 10 years ago
parent
commit
1cef3c29c4
1 changed files with 4 additions and 1 deletions
  1. 4 1
      php/modules/Import.php

+ 4 - 1
php/modules/Import.php

@@ -87,8 +87,11 @@ class Import extends Module {
 
 				$out = '';
 				$ret = '';
+				$file = escapeshellarg($file);
+				$cmd = $osmv . " $file " . LYCHEE_DATA . $tmpdirname;
+
+				@exec($cmd, $out, $ret);
 
-				@exec($osmv . ' ' . $file . ' ' . LYCHEE_DATA . $tmpdirname, $out, $ret);
 				if (isset($ret)&&($ret>0)) Log::error($database, __METHOD__, __LINE__, "Failed to move directory or file ($ret):" . $file);
 
 			}