From 4cc53cbb1422f5ab6771071b59e0f03f6acef926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Sat, 18 May 2002 15:08:31 +0000 Subject: [PATCH] * removed ^M * ensure user agent is detected whatever are the PHP version and the "register globals" value --- ChangeLog | 3 +++ fpdf/fpdf.php3 | 19 +++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4ff744749..722bc2035 100755 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,9 @@ $Source$ - better ip checking. * Documentation.html: typos and line sizes. * tbl_qbe.php3: cleanup. + * fpdf/*: removed ^M. + * fpdf/fpdf.php3, lines 1205+: ensure user agent is detected whatever are + the PHP version and the "register globals" value. 2002-05-17 Robin Johnson * config.inc.php3, libraries/common.lib.php3: IP-based Allow/Deny code diff --git a/fpdf/fpdf.php3 b/fpdf/fpdf.php3 index d799385a3..c86a9c8a9 100755 --- a/fpdf/fpdf.php3 +++ b/fpdf/fpdf.php3 @@ -1202,11 +1202,22 @@ function _out($s) //End of class } +// loic1: get the user agent whatever are the PHP version and the +// "register globals" value +if (!empty($_SERVER) && isset($_SERVER['HTTP_USER_AGENT'])) { + $HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT']; +} +else if (!empty($_ENV) && isset($_ENV['HTTP_USER_AGENT'])) { + $HTTP_USER_AGENT = $__ENV['HTTP_USER_AGENT']; +} +else if (!empty($HTTP_ENV_VARS) && isset($HTTP_ENV_VARS['HTTP_USER_AGENT'])) { + $HTTP_USER_AGENT = $HTTP_ENV_VARS['HTTP_USER_AGENT']; +} + //Handle silly IE contype request -if(isset($HTTP_ENV_VARS['HTTP_USER_AGENT']) and $HTTP_ENV_VARS['HTTP_USER_AGENT']=='contype') -{ - Header('Content-Type: application/pdf'); - exit; +if (isset($HTTP_USER_AGENT) and $HTTP_USER_AGENT == 'contype') { + header('Content-Type: application/pdf'); + exit(); } ?>