Full fix for issue #43

master
pecesama 2007-09-23 22:36:19 +00:00
parent aae90554cf
commit 6f8f1924b3
2 changed files with 6 additions and 3 deletions

View File

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

View File

@ -85,16 +85,19 @@ if(!defined('entry') || !entry) die('Not a valid page');
} }
function getFile($remoteFileName) { function getFile($remoteFileName) {
$fileName = "../uploads/".sanitizeName($remoteFileName); $fileName = "../uploads/".sanitizeName(getFileName($remoteFileName));
$str = _file_get_contents($remoteFileName); $str = _file_get_contents($remoteFileName);
if (!$handle = fopen($fileName, 'w')) { if (!$handle = fopen($fileName, 'w')) {
//die("no se abrio de escritura");
return false; return false;
} }
if (fwrite($handle, $str) === FALSE) { if (fwrite($handle, $str) === FALSE) {
//die("no se escribio");
return false; return false;
} }
fclose($handle); fclose($handle);
return true; return true;
} }
function isVimeoVideo($videoUrl) { function isVimeoVideo($videoUrl) {