Explorar o código

Provide a more useful name for the split directory, for restless admins

Zachary Kotlarek %!s(int64=12) %!d(string=hai) anos
pai
achega
4a5725e7b8
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      opendrive.php

+ 8 - 1
opendrive.php

@@ -371,7 +371,14 @@ function fileUpload($session, $path, $file) {
 		}
 
 		# Create a temporary directory
-		$tempDir = trim(shell_exec('mktemp -d'));
+		$tempDir = trim(
+			shell_exec(
+				'mktemp' .
+				' -d' .
+				' --tmpdir=' . escapeshellarg(sys_get_temp_dir()) .
+				' ' . escapeshellarg(basename($file)) . '.XXXXXXXX'
+			)
+		);
 		if (!is_dir($tempDir)) {
 			echo "Unable to create temp directory\n";
 			return false;