From 6459055567898a1934e9a6855fb3baddb69ff8b2 Mon Sep 17 00:00:00 2001 From: Riccardo Di Dato Date: Thu, 31 Mar 2016 14:14:20 +0200 Subject: [PATCH] supporto per estensione diversa da .pdf per i pdf --- public/getPDF.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/getPDF.php b/public/getPDF.php index 5ab897a..5eec27e 100644 --- a/public/getPDF.php +++ b/public/getPDF.php @@ -10,9 +10,9 @@ if (array_key_exists("id",$_GET)) { $pdfModel = GlobalVariables::get("dao")->getFirst("MediaModel",array("id"=>$_GET['id'])); $id = $_GET["id"]; if (!is_null($pdfModel)){ - $localFilePath = GlobalVariables::get("config")->paths->media."/".$id.".pdf"; + $localFilePath = GlobalVariables::get("config")->paths->media."/".$id.".".$pdfModel->extension; if (SFSManager::fileExists($localFilePath)){ - $exposedFilePath = GlobalVariables::get("config")->paths->xsendfile."/".$id.".pdf"; + $exposedFilePath = GlobalVariables::get("config")->paths->xsendfile."/".$id.".".$pdfModel->extension; if (!SFSManager::fileExists($exposedFilePath)){ SystemController::shellExec("ln",'-s "'.$localFilePath.'" "'.$exposedFilePath.'"'); }