* removed ^M

* ensure user agent is detected whatever are the PHP version and the "register globals" value
This commit is contained in:
Loïc Chapeaux
2002-05-18 15:08:31 +00:00
parent 4dc2ae1887
commit 4cc53cbb14
2 changed files with 18 additions and 4 deletions

View File

@@ -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 <robbat2@users.sourceforge.net>
* config.inc.php3, libraries/common.lib.php3: IP-based Allow/Deny code

View File

@@ -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();
}
?>