Inserito intval in add multimedia sul tipo
This commit is contained in:
@@ -21,7 +21,7 @@ try{
|
||||
throw new CoreException("Trying to add a media to an invalid model with id '".$notiziaId. "'");
|
||||
}
|
||||
else{
|
||||
$mediaTypeSaved = PostHandler::get("mediaType");
|
||||
$mediaTypeSaved = intval(PostHandler::get("mediaType"));
|
||||
if(array_key_exists("action", $_POST) && strcmp(PostHandler::get("action"), "save")==0){
|
||||
$notizia = GlobalVariables::get("dao")->getFirst("NotiziaModel",array("id"=>$notiziaId));
|
||||
|
||||
|
||||
+9
-7
@@ -11,14 +11,16 @@ if (array_key_exists("id",$_GET)) {
|
||||
$id = $_GET["id"];
|
||||
if (!is_null($pdfModel)){
|
||||
$localFilePath = GlobalVariables::get("config")->paths->media."/".$id.".pdf";
|
||||
$exposedFilePath = GlobalVariables::get("config")->paths->xsendfile."/".$id.".pdf";
|
||||
if (!SFSManager::fileExists($exposedFilePath)){
|
||||
SystemController::shellExec("ln",'-s "'.$localFilePath.'" "'.$exposedFilePath.'"');
|
||||
if (SFSManager::fileExists($localFilePath)){
|
||||
$exposedFilePath = GlobalVariables::get("config")->paths->xsendfile."/".$id.".pdf";
|
||||
if (!SFSManager::fileExists($exposedFilePath)){
|
||||
SystemController::shellExec("ln",'-s "'.$localFilePath.'" "'.$exposedFilePath.'"');
|
||||
}
|
||||
header('X-Sendfile: '.$exposedFilePath.'');
|
||||
|
||||
header("Content-type: application/octet-stream");
|
||||
header('Content-Disposition: attachment; filename="' . basename($exposedFilePath) . '"');
|
||||
}
|
||||
header('X-Sendfile: '.$exposedFilePath.'');
|
||||
|
||||
header("Content-type: application/octet-stream");
|
||||
header('Content-Disposition: attachment; filename="' . basename($exposedFilePath) . '"');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user