Changeset 14f22f3 in github
- Timestamp:
- May 12, 2012 12:16:19 PM (12 months ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo
- Children:
- 3c5489b
- Parents:
- 1c9e571
- File:
-
- 1 edited
-
program/include/rcube_message.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
program/include/rcube_message.php
rbe98dfc2 r14f22f3 656 656 $parts = array(); 657 657 // FIXME: line length is max.65? 658 $uu_regexp = '/begin [0-7]{3,4} ([^\n]+)\n (([\x21-\x7E]{0,65}\n)+)`\nend/s';658 $uu_regexp = '/begin [0-7]{3,4} ([^\n]+)\n/s'; 659 659 660 660 if (preg_match_all($uu_regexp, $part->body, $matches, PREG_SET_ORDER)) { 661 // remove attachments bodies from the message body662 $part->body = preg_replace($uu_regexp, '', $part->body);663 661 // update message content-type 664 662 $part->ctype_primary = 'multipart'; 665 663 $part->ctype_secondary = 'mixed'; 666 664 $part->mimetype = $part->ctype_primary . '/' . $part->ctype_secondary; 665 $uu_endstring = "`\nend\n"; 667 666 668 667 // add attachments to the structure 669 668 foreach ($matches as $pid => $att) { 669 $startpos = strpos($part->body, $att[1]) + strlen($att[1]) + 1; // "\n" 670 $endpos = strpos($part->body, $uu_endstring); 671 $filebody = substr($part->body, $startpos, $endpos-$startpos); 672 673 // remove attachments bodies from the message body 674 $part->body = substr_replace($part->body, "", $startpos, $endpos+strlen($uu_endstring)-$startpos); 675 670 676 $uupart = new rcube_message_part; 671 677 672 678 $uupart->filename = trim($att[1]); 673 679 $uupart->encoding = 'stream'; 674 $uupart->body = convert_uudecode($ att[2]);680 $uupart->body = convert_uudecode($filebody); 675 681 $uupart->size = strlen($uupart->body); 676 682 $uupart->mime_id = 'uu.' . $part->mime_id . '.' . $pid; … … 683 689 unset($matches[$pid]); 684 690 } 691 692 // remove attachments bodies from the message body 693 $part->body = preg_replace($uu_regexp, '', $part->body); 685 694 } 686 695
Note: See TracChangeset
for help on using the changeset viewer.
