Преглед изворни кода

Force the addition of a file suffix to attachments that lack a filename (helps forwarded messages avoid spam filters) (Thanks to Petr Kletecka) (#3139004)

pdontthink пре 14 година
родитељ
комит
c4785809ee
2 измењених фајлова са 7 додато и 4 уклоњено
  1. 4 4
      class/mime/Message.class.php
  2. 3 0
      doc/ChangeLog

+ 4 - 4
class/mime/Message.class.php

@@ -161,9 +161,9 @@ class Message {
                       $name = $header->getParameter('name');
                       if(!trim($name)) {
                           if (!trim( $header->id )) {
-                              $filename = 'untitled-[' . $this->entity_id . ']' ;
+                              $filename = 'untitled-[' . $this->entity_id . ']' . '.' . strtolower($header->type1);
                           } else {
-                              $filename = 'cid: ' . $header->id;
+                              $filename = 'cid: ' . $header->id . '.' . strtolower($header->type1);
                           }
                       } else {
                           $filename = $name;
@@ -178,9 +178,9 @@ class Message {
                   $filename = $header->getParameter('name');
                   if (!trim($filename)) {
                       if (!trim( $header->id )) {
-                          $filename = 'untitled-[' . $this->entity_id . ']' ;
+                          $filename = 'untitled-[' . $this->entity_id . ']' . '.' . strtolower($header->type1);
                       } else {
-                          $filename = 'cid: ' . $header->id;
+                          $filename = 'cid: ' . $header->id . '.' . strtolower($header->type1);
                       }
                   }
               }

+ 3 - 0
doc/ChangeLog

@@ -353,6 +353,9 @@ Version 1.5.2 - SVN
   - Now allow multiple plugins to handle (add links for) a single
     attachment MIME type.
   - Fixed sqauth_read_password() for plugins on the login_verified hook.
+  - Forced addition of a file suffix to attachments that lack a filename
+    (helps forwarded messages avoid spam filters) (Thanks to Petr
+    Kletecka) (#3139004).
 
 Version 1.5.1 (branched on 2006-02-12)
 --------------------------------------