Changeset 42e328a in github
- Timestamp:
- Sep 19, 2008 3:42:11 PM (5 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- cc80c55
- Parents:
- 29111be
- File:
-
- 1 edited
-
program/include/rcube_imap.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
program/include/rcube_imap.php
r20a2519 r42e328a 1203 1203 // TODO: fetch only Content-Type/Content-Disposition header 1204 1204 $headers = iil_C_FetchPartHeader($this->conn, $this->mailbox, $this->_msg_id, $part->mime_id); 1205 $filename_mime = '';1206 $i = 0;1207 while (preg_match('/filename\*'.$i.'\s*=\s*"*([^"\n;]+)[";]*/', $headers, $matches)) {1208 $filename_mime .= $matches[1];1209 $i++;1210 }1211 }1212 }1205 $filename_mime = ''; 1206 $i = 0; 1207 while (preg_match('/filename\*'.$i.'\s*=\s*"*([^"\n;]+)[";]*/', $headers, $matches)) { 1208 $filename_mime .= $matches[1]; 1209 $i++; 1210 } 1211 } 1212 } 1213 1213 else if (!empty($part->d_parameters['filename*0*'])) { 1214 1214 $i = 0; 1215 1215 while (isset($part->d_parameters['filename*'.$i.'*'])) { 1216 1216 $i++; 1217 $filename_encoded .= $part->d_parameters['filename*'.$i.'*'];1218 }1217 $filename_encoded .= $part->d_parameters['filename*'.$i.'*']; 1218 } 1219 1219 if ($i<2) { 1220 1220 $headers = iil_C_FetchPartHeader($this->conn, $this->mailbox, $this->_msg_id, $part->mime_id); 1221 $filename_encoded = '';1222 $i = 0; $matches = array();1223 while (preg_match('/filename\*'.$i.'\*\s*=\s*"*([^"\n;]+)[";]*/', $headers, $matches)) {1224 $filename_encoded .= $matches[1];1225 $i++;1226 }1227 }1228 }1221 $filename_encoded = ''; 1222 $i = 0; $matches = array(); 1223 while (preg_match('/filename\*'.$i.'\*\s*=\s*"*([^"\n;]+)[";]*/', $headers, $matches)) { 1224 $filename_encoded .= $matches[1]; 1225 $i++; 1226 } 1227 } 1228 } 1229 1229 else if (!empty($part->ctype_parameters['name*0'])) { 1230 1230 $i = 0; … … 1232 1232 $i++; 1233 1233 $filename_mime .= $part->ctype_parameters['name*'.$i]; 1234 }1234 } 1235 1235 if ($i<2) { 1236 1236 $headers = iil_C_FetchPartHeader($this->conn, $this->mailbox, $this->_msg_id, $part->mime_id); 1237 $filename_mime = '';1238 $i = 0; $matches = array();1239 while (preg_match('/\s+name\*'.$i.'\s*=\s*"*([^"\n;]+)[";]*/', $headers, $matches)) {1240 $filename_mime .= $matches[1];1241 $i++;1242 }1243 }1244 }1237 $filename_mime = ''; 1238 $i = 0; $matches = array(); 1239 while (preg_match('/\s+name\*'.$i.'\s*=\s*"*([^"\n;]+)[";]*/', $headers, $matches)) { 1240 $filename_mime .= $matches[1]; 1241 $i++; 1242 } 1243 } 1244 } 1245 1245 else if (!empty($part->ctype_parameters['name*0*'])) { 1246 1246 $i = 0; … … 1248 1248 $i++; 1249 1249 $filename_encoded .= $part->ctype_parameters['name*'.$i.'*']; 1250 }1250 } 1251 1251 if ($i<2) { 1252 1252 $headers = iil_C_FetchPartHeader($this->conn, $this->mailbox, $this->_msg_id, $part->mime_id); 1253 $filename_encoded = '';1254 $i = 0; $matches = array();1255 while (preg_match('/\s+name\*'.$i.'\*\s*=\s*"*([^"\n;]+)[";]*/', $headers, $matches)) {1256 $filename_encoded .= $matches[1];1257 $i++;1258 }1259 }1260 }1253 $filename_encoded = ''; 1254 $i = 0; $matches = array(); 1255 while (preg_match('/\s+name\*'.$i.'\*\s*=\s*"*([^"\n;]+)[";]*/', $headers, $matches)) { 1256 $filename_encoded .= $matches[1]; 1257 $i++; 1258 } 1259 } 1260 } 1261 1261 // Content-Disposition 1262 1262 else if (!empty($part->headers['content-description'])) … … 1268 1268 if (!empty($filename_mime)) { 1269 1269 $part->filename = rcube_imap::decode_mime_string($filename_mime, 1270 $part->charset ? $part->charset : rc_detect_encoding($filename_mime, $this->default_charset));1270 $part->charset ? $part->charset : rc_detect_encoding($filename_mime, $this->default_charset)); 1271 1271 } 1272 1272 else if (!empty($filename_encoded)) { … … 1343 1343 { 1344 1344 fwrite($fp, $body); 1345 return true;1345 return true; 1346 1346 } 1347 1347 }
Note: See TracChangeset
for help on using the changeset viewer.
