From 886fe0a0912bf23d37934b5001b5b14f461489e5 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 27 Jan 2005 18:06:14 +0000 Subject: [PATCH] bug #1106146, missing header for PDF --- ChangeLog | 4 ++++ libraries/fpdf/fpdf.php | 15 +++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c7ea30df5..90bcd416d 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ phpMyAdmin - Changelog $Id$ $Source$ +2005-01-27 Marc Delisle + $ libraries/fpdf/fpdf.php: bug #1106146, missing header for PDF, + thanks to Michal + 2005-01-27 Michal Čihař * read_dump.php: Fix detection of SELECT query to display on multiple submits (bug #1110727). diff --git a/libraries/fpdf/fpdf.php b/libraries/fpdf/fpdf.php index 7cf4a65f4..c5ef5e3f5 100644 --- a/libraries/fpdf/fpdf.php +++ b/libraries/fpdf/fpdf.php @@ -993,7 +993,8 @@ function SetXY($x,$y) function Output($name='',$dest='') { //Output PDF to some destination - global $HTTP_SERVER_VARS; + // lem9 + //global $HTTP_SERVER_VARS; //Finish document if necessary if($this->state<3) @@ -1016,7 +1017,9 @@ function Output($name='',$dest='') { case 'I': //Send to standard output - if(isset($HTTP_SERVER_VARS['SERVER_NAME'])) + // lem9 + //if(isset($HTTP_SERVER_VARS['SERVER_NAME'])) + if(isset($_SERVER['SERVER_NAME'])) { //We send to a browser Header('Content-Type: application/pdf'); @@ -1029,7 +1032,9 @@ function Output($name='',$dest='') break; case 'D': //Download file - if(isset($HTTP_SERVER_VARS['HTTP_USER_AGENT']) and strpos($HTTP_SERVER_VARS['HTTP_USER_AGENT'],'MSIE')) + // lem9 + //if(isset($HTTP_SERVER_VARS['HTTP_USER_AGENT']) and strpos($HTTP_SERVER_VARS['HTTP_USER_AGENT'],'MSIE')) + if(isset($_SERVER['HTTP_USER_AGENT']) and strpos($_SERVER['HTTP_USER_AGENT'],'MSIE')) Header('Content-Type: application/force-download'); else Header('Content-Type: application/octet-stream'); @@ -1612,7 +1617,9 @@ function _out($s) } //Handle special IE contype request -if(isset($HTTP_SERVER_VARS['HTTP_USER_AGENT']) and $HTTP_SERVER_VARS['HTTP_USER_AGENT']=='contype') +// lem9 +//if(isset($HTTP_SERVER_VARS['HTTP_USER_AGENT']) and $HTTP_SERVER_VARS['HTTP_USER_AGENT']=='contype') +if(isset($_SERVER['HTTP_USER_AGENT']) and $_SERVER['HTTP_USER_AGENT']=='contype') { Header('Content-Type: application/pdf'); exit;