Browse Source

Full fix for issue #43

pecesama 18 years ago
parent
commit
6f8f1924b3
2 changed files with 6 additions and 3 deletions
  1. 1 1
      admin/index.php
  2. 5 2
      classes/functions.php

+ 1 - 1
admin/index.php View File

40
 					header("Location: ".$conf->urlGelato."/admin/index.php?photo=false");
40
 					header("Location: ".$conf->urlGelato."/admin/index.php?photo=false");
41
 					die();
41
 					die();
42
 				}
42
 				}
43
-				$_POST["url"] = "../uploads/".$photoName;
43
+				$_POST["url"] = "../uploads/".sanitizeName($photoName);
44
 			}
44
 			}
45
 			
45
 			
46
 			if ( move_uploaded_file( $_FILES['photo']['tmp_name'], "../uploads/".sanitizeName($_FILES['photo']['name']) ) ) {
46
 			if ( move_uploaded_file( $_FILES['photo']['tmp_name'], "../uploads/".sanitizeName($_FILES['photo']['name']) ) ) {

+ 5 - 2
classes/functions.php View File

85
 	}
85
 	}
86
 	
86
 	
87
 	function getFile($remoteFileName) {
87
 	function getFile($remoteFileName) {
88
-		$fileName = "../uploads/".sanitizeName($remoteFileName);
88
+		$fileName = "../uploads/".sanitizeName(getFileName($remoteFileName));		
89
 		$str = _file_get_contents($remoteFileName);
89
 		$str = _file_get_contents($remoteFileName);
90
 		if (!$handle = fopen($fileName, 'w')) {
90
 		if (!$handle = fopen($fileName, 'w')) {
91
+			//die("no se abrio de escritura");
91
 			return false;
92
 			return false;
92
 		}
93
 		}
94
+		
93
 		if (fwrite($handle, $str) === FALSE) {
95
 		if (fwrite($handle, $str) === FALSE) {
96
+			//die("no se escribio");
94
 			return false;
97
 			return false;
95
 		}
98
 		}
96
 		fclose($handle);
99
 		fclose($handle);
97
-		return true;		
100
+		return true;	
98
 	}
101
 	}
99
 	
102
 	
100
 	function isVimeoVideo($videoUrl) {
103
 	function isVimeoVideo($videoUrl) {