From 52ad33f5b2c9de883a5e10b27bd55653d1358b4b Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Mon, 7 Sep 2015 14:18:08 +0000 Subject: [PATCH] Forced the PDF produced by the impact analysis to be downloaded as an attachment, otherwise on some browsers the result cannot be saved. SVN:trunk[3725] --- application/pdfpage.class.inc.php | 6 +----- pages/ajax.render.php | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/application/pdfpage.class.inc.php b/application/pdfpage.class.inc.php index e1c50c59e..8b07d392b 100644 --- a/application/pdfpage.class.inc.php +++ b/application/pdfpage.class.inc.php @@ -89,7 +89,6 @@ class PDFPage extends WebPage // Add a page, we're ready to start $this->oPdf->AddPage(); - $this->SetContentType('application/pdf'); $this->SetContentDisposition('inline', $s_title.'.pdf'); $this->SetDefaultStyle(); @@ -174,10 +173,7 @@ EOF */ public function output() { - if (!empty($this->sContentType)) - { - $this->add_header('Content-type: '.$this->sContentType); - } + $this->add_header('Content-type: application/x-pdf'); if (!empty($this->sContentDisposition)) { $this->add_header('Content-Disposition: '.$this->sContentDisposition.'; filename="'.$this->sContentFileName.'"'); diff --git a/pages/ajax.render.php b/pages/ajax.render.php index 56e73b9f1..88c450aab 100644 --- a/pages/ajax.render.php +++ b/pages/ajax.render.php @@ -1816,6 +1816,7 @@ EOF } $oPage = new PDFPage($sTitle, $sPageFormat, $sPageOrientation); + $oPage->SetContentDisposition('attachment', $sTitle.'.pdf'); $oGraph = DisplayableGraph::FromRelationGraph($oRelGraph, $iGroupingThreshold, ($sDirection == 'down')); $oGraph->InitFromGraphviz();