Full fix for issue #43
parent
aae90554cf
commit
6f8f1924b3
|
|
@ -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']) ) ) {
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue