From be72fb3597c21ca3aaa058adf41bb72d53d197c7 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Fri, 28 Dec 2012 06:40:57 -0500
Subject: [PATCH] Unified attachments filenames handling for message parts without a filename

---
 program/lib/Roundcube/rcube_message.php |   21 ---------------------
 1 files changed, 0 insertions(+), 21 deletions(-)

diff --git a/program/lib/Roundcube/rcube_message.php b/program/lib/Roundcube/rcube_message.php
index 9fea838..d450bb4 100644
--- a/program/lib/Roundcube/rcube_message.php
+++ b/program/lib/Roundcube/rcube_message.php
@@ -106,7 +106,6 @@
         if (!empty($this->headers->structure)) {
             $this->get_mime_numbers($this->headers->structure);
             $this->parse_structure($this->headers->structure);
-            $this->parse_attachments();
         }
         else {
             $this->body = $this->storage->get_body($uid);
@@ -646,26 +645,6 @@
         // message is a single part non-text (without filename)
         else if (preg_match('/application\//i', $mimetype)) {
             $this->attachments[] = $structure;
-        }
-    }
-
-
-    /**
-     * Parse attachment parts
-     */
-    private function parse_attachments()
-    {
-        // Attachment must have a name
-        foreach ($this->attachments as $attachment) {
-            if (!$attachment->filename) {
-                $ext = rcube_mime::get_mime_extensions($attachment->mimetype);
-                $ext = array_shift($ext);
-
-                $attachment->filename = 'Part_' . $attachment->mime_id;
-                if ($ext) {
-                    $attachment->filename .= '.' . $ext;
-                }
-            }
         }
     }
 

--
Gitblit v1.9.1