Browse code

Pad EXIF program string

Jenga Phoenix authored on 2019-01-27 06:13:49
Showing 2 changed files
... ...
@@ -30,7 +30,7 @@ switch (true) {
30 30
 	case (move_uploaded_file($_FILES["uploadcoin"]["tmp_name"], $dest_file)
31 31
 	&& write_metadata($dest_file, $_POST["file_source"])):
32 32
 
33
-		if (in_array(file_extension($dest_file)),array("jpg","jpeg")) {
33
+		if (in_array(file_extension($dest_file),array("jpg","jpeg"))) {
34 34
 			sanitize_image($dest_file);
35 35
 		}
36 36
 
... ...
@@ -1,6 +1,5 @@
1 1
 <?php
2 2
 
3
-
4 3
 // FILENAME --> SAFE_FILENAME_STRING
5 4
 //	Sanitize a filename by replacing common suspicious characters with "_".
6 5
 function sanitize_filename($filename)
... ...
@@ -22,7 +21,9 @@ function sanitize_filename($filename)
22 21
 //	Sanitize an image (EXIF, etc) with external program from config.php
23 22
 function sanitize_image($path)
24 23
 {
25
-	exec($image_sanitize_command . $image_sanitize_args . $path, $result);
24
+	exec($GLOBALS['image_sanitize_command'] . ' '
25
+		. $GLOBALS['image_sanitize_args'] . ' '
26
+		. $path, $result);
26 27
 
27 28
 	return $path;
28 29
 }