소스 검색

get the filename from the properties if the is no disposition info available
in the bodystructure.

stekkel 22 년 전
부모
커밋
f3b443c708
1개의 변경된 파일9개의 추가작업 그리고 7개의 파일을 삭제
  1. 9 7
      functions/mime.php

+ 9 - 7
functions/mime.php

@@ -442,13 +442,15 @@ function formatAttachments($message, $exclude_id, $mailbox, $id) {
                     }
                     }
                 }
                 }
             } else {
             } else {
-                if (trim( $header->id ) == '') {
-                    $filename = 'untitled-[' . $ent . ']' ;
-                } else {
-                    $filename = 'cid: ' . $header->id;
-                }
-            }
-
+		$filename = decodeHeader($header->getParameter('name'));
+		if (!trim($filename)) {
+            	    if (trim( $header->id ) == '') {
+                	$filename = 'untitled-[' . $ent . ']' ;
+            	    } else {
+                	$filename = 'cid: ' . $header->id;
+            	    }
+        	}
+	    }
             if ($header->description) {
             if ($header->description) {
                 $description = htmlspecialchars($header->description);
                 $description = htmlspecialchars($header->description);
             } else {
             } else {