Browse Source

fix for displaying attachment names

stekkel 23 năm trước cách đây
mục cha
commit
604ea60204
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      functions/mime.php

+ 2 - 1
functions/mime.php

@@ -408,7 +408,7 @@ function formatAttachments($message, $exclude_id, $mailbox, $id) {
                         "<TD><SMALL>[ $type0/$type1 ]&nbsp;</SMALL></TD>" .
                         "<TD><SMALL>[ $type0/$type1 ]&nbsp;</SMALL></TD>" .
                         '<TD><SMALL>';
                         '<TD><SMALL>';
 	    $from_o = $header->from;
 	    $from_o = $header->from;
-	    if (isset($from_o)) {
+	    if (is_object($from_o)) {
 		$from_name = $from_o->getAddress(false);
 		$from_name = $from_o->getAddress(false);
 	    } else {
 	    } else {
 		$from_name = _("Unknown sender");
 		$from_name = _("Unknown sender");
@@ -430,6 +430,7 @@ function formatAttachments($message, $exclude_id, $mailbox, $id) {
         } else {
         } else {
             $filename = decodeHeader($header->filename);
             $filename = decodeHeader($header->filename);
             if (trim($filename) == '') {
             if (trim($filename) == '') {
+	        $name = decodeHeader($header->name);
                 if (trim($name) == '') {
                 if (trim($name) == '') {
                     if ( trim( $header->id ) == '' )
                     if ( trim( $header->id ) == '' )
                         $display_filename = 'untitled-[' . $ent . ']' ;
                         $display_filename = 'untitled-[' . $ent . ']' ;