소스 검색

- Make test for IE6 in SendDownloadHeaders also match versions higher
than 6 (#1339211).

Thijs Kinkhorst 19 년 전
부모
커밋
9c8824c3bc
2개의 변경된 파일8개의 추가작업 그리고 7개의 파일을 삭제
  1. 2 1
      ChangeLog
  2. 6 6
      functions/mime.php

+ 2 - 1
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
 -------------------------------

+ 6 - 6
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)