Changeset 0ced2b9 in github
- Timestamp:
- Aug 22, 2008 5:58:48 AM (5 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 26f5b09
- Parents:
- f74b283
- Location:
- program
- Files:
-
- 2 edited
-
include/rcube_browser.php (modified) (1 diff)
-
steps/mail/get.inc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
program/include/rcube_browser.php
r47124c22 r0ced2b9 39 39 $this->unix = stristr($HTTP_USER_AGENT, 'unix'); 40 40 41 $this->opera = stristr($HTTP_USER_AGENT, 'opera'); 41 42 $this->ns4 = stristr($HTTP_USER_AGENT, 'mozilla/4') && !stristr($HTTP_USER_AGENT, 'msie'); 42 43 $this->ns = ($this->ns4 || stristr($HTTP_USER_AGENT, 'netscape')); 43 $this->ie = stristr($HTTP_USER_AGENT, ' msie');44 $this->ie = stristr($HTTP_USER_AGENT, 'compatible; msie') && !$this->opera; 44 45 $this->mz = stristr($HTTP_USER_AGENT, 'mozilla/5'); 45 $this->opera = stristr($HTTP_USER_AGENT, 'opera');46 46 $this->safari = stristr($HTTP_USER_AGENT, 'safari'); 47 47 -
program/steps/mail/get.inc
r2c6fa93 r0ced2b9 55 55 $ctype_secondary = strtolower($part->ctype_secondary); 56 56 $mimetype = sprintf('%s/%s', $ctype_primary, $ctype_secondary); 57 58 $browser = new rcube_browser; 57 59 58 60 header("Expires: 0"); … … 63 65 // send download headers 64 66 if ($_GET['_download']) { 65 header("Cache-Control: private", false);66 67 header("Content-Type: application/octet-stream"); 68 if ($browser->ie) 69 header("Content-Type: application/force-download"); 67 70 } 68 71 else if ($ctype_primary == 'text') 69 header("Content-Type: text/$ctype_secondary; charset=" . RCMAIL_CHARSET);72 header("Content-Type: text/$ctype_secondary; charset=" . ($part->charset ? $part->charset : RCMAIL_CHARSET)); 70 73 else 71 74 header("Content-Type: $mimetype"); … … 79 82 // deliver part content 80 83 if ($ctype_primary == 'text' && $ctype_secondary == 'html') { 81 // we have to analyze the whole structure again to find inline objects82 /* what was this good for again ?83 list($new_parts, $new_attachments) =84 rcmail_parse_message($MESSAGE['structure'],85 array('safe' => intval($_GET['_safe']),86 'prefer_html' => TRUE,87 'get_url' => $GET_URL.'&_part=%s'));88 89 $all_parts = array_merge($new_parts, $new_attachments);90 for ($partix = 0; $partix < sizeof($all_parts); $partix++)91 if ($all_parts[$partix]->mime_id == $pid)92 $part = &$all_parts[$partix];93 */94 95 84 // get part body if not available 96 85 if (!$part->body) … … 101 90 } 102 91 else { 103 header(sprintf('Content-Length: %d', $part->size)); 104 header(sprintf('Content-Disposition: %s; filename="%s";', 105 $_GET['_download'] ? 'attachment' : 'inline', 106 $part->filename ? abbreviate_string($part->filename, 55) : "roundcube.$ctype_secondary")); 92 // don't kill the connection if download takes more than 30 sec. 93 if (!ini_get('safe_mode')) { 94 set_time_limit(0); 95 } 96 97 $filename = $part->filename ? $part->filename : ($MESSAGE->subject ? $MESSAGE->subject : 'roundcube') . '.'.$ctype_secondary; 98 $filename = abbreviate_string($part->filename, 55); 99 $filename = $browser->ie ? rawurlencode($filename) : addslashes($filename); 100 $disposition = !empty($_GET['_download']) ? 'attachment' : 'inline'; 101 102 header("Content-Disposition: $disposition; filename=\"$filename\""); 107 103 108 104 // turn off output buffering and print part content
Note: See TracChangeset
for help on using the changeset viewer.
