From cfffd60b969750c049a4367d426b3cedc3dc1cba Mon Sep 17 00:00:00 2001 From: kink Date: Wed, 9 Nov 2005 21:51:16 +0000 Subject: [PATCH] - Make test for IE6 in SendDownloadHeaders also match versions higher than 6 (#1339211). git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10310 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 3 ++- functions/mime.php | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0a7a41f3..79d3e8e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -475,7 +475,8 @@ Version 1.5.1 -- CVS - Undefined index in addressbook backends. - sqimap_utf7_decode_mbx_tree returns variables by reference, rather than a return value (#1351822) - + - Make test for IE6 in SendDownloadHeaders also match versions higher + than 6 (#1339211). Version 1.5.0 - 2 February 2004 ------------------------------- diff --git a/functions/mime.php b/functions/mime.php index 682d3cb3..9dd61e3f 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -2283,18 +2283,18 @@ function magicHTML($body, $id, $message, $mailbox = 'INBOX', $take_mailto_links */ function SendDownloadHeaders($type0, $type1, $filename, $force, $filesize=0) { global $languages, $squirrelmail_language; - $isIE = $isIE6 = 0; + $isIE = $isIE6plus = false; sqgetGlobalVar('HTTP_USER_AGENT', $HTTP_USER_AGENT, SQ_SERVER); if (strstr($HTTP_USER_AGENT, 'compatible; MSIE ') !== false && strstr($HTTP_USER_AGENT, 'Opera') === false) { - $isIE = 1; + $isIE = true; } - if (strstr($HTTP_USER_AGENT, 'compatible; MSIE 6') !== false && - strstr($HTTP_USER_AGENT, 'Opera') === false) { - $isIE6 = 1; + if (preg_match('/compatible; MSIE ([0-9]+)/', $HTTP_USER_AGENT, $match) && + ((int)$match[1]) >= 6 && strstr($HTTP_USER_AGENT, 'Opera') === false) { + $isIE6plus = true; } if (isset($languages[$squirrelmail_language]['XTRA_CODE']) && @@ -2351,7 +2351,7 @@ function SendDownloadHeaders($type0, $type1, $filename, $force, $filesize=0) { // "attachment"... does it apply to inline too? header ("Content-Disposition: attachment; filename=\"$filename\""); - if ($isIE && !$isIE6) { + if ($isIE && !$isIE6plus) { // This combination seems to work mostly. IE 5.5 SP 1 has // known issues (see the Microsoft Knowledge Base) -- 2.25.1