From 7a5c48e7f70b8bc938fcae3ffd2be0fdbeaab145 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Wed, 13 Dec 2006 02:17:24 -0500
Subject: [PATCH] Changed 'junk' label in French localization

---
 program/lib/Mail/mime.php |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/program/lib/Mail/mime.php b/program/lib/Mail/mime.php
index eb48073..a9f798e 100644
--- a/program/lib/Mail/mime.php
+++ b/program/lib/Mail/mime.php
@@ -198,6 +198,16 @@
     }
 
     /**
+    * returns the HTML body portion of the message
+    * @return string HTML body of the message
+    * @access public
+    */
+    function getHTMLBody()
+    {
+       return $this->_htmlbody;
+    }
+    
+    /**
      * Adds an image to the list of embedded images.
      *
      * @param  string  $file       The image file name OR image data itself
@@ -206,11 +216,13 @@
      *                             Only use if $file is the image data
      * @param  bool    $isfilename Whether $file is a filename or not
      *                             Defaults to true
+     * @param  string  $contentid  Desired Content-ID of MIME part
+     *                             Defaults to generated unique ID
      * @return mixed   true on success or PEAR_Error object
      * @access public
      */
     function addHTMLImage($file, $c_type='application/octet-stream',
-                          $name = '', $isfilename = true)
+                          $name = '', $isfilename = true, $contentid = '')
     {
         $filedata = ($isfilename === true) ? $this->_file2str($file)
                                            : $file;
@@ -222,11 +234,14 @@
         if (PEAR::isError($filedata)) {
             return $filedata;
         }
+        if ($contentid == '') {
+           $contentid = md5(uniqid(time()));
+        }
         $this->_html_images[] = array(
                                       'body'   => $filedata,
                                       'name'   => $filename,
                                       'c_type' => $c_type,
-                                      'cid'    => md5(uniqid(time()))
+                                      'cid'    => $contentid
                                      );
         return true;
     }
@@ -805,7 +820,7 @@
                 if (preg_match('#[\x80-\xFF]{1}#', $value)) {
                     $suffix = '';
                     // Don't encode e-mail address
-                    if (preg_match('/(.+)\s(<.+@[a-z0-9\-\.]+\.[a-z]{2,5}>)$/Ui', $value, $matches)) {
+                    if (preg_match('/(.+)\s(<.+@[a-z0-9\-\.]+>)$/Ui', $value, $matches)) {
                         $value = $matches[1];
                         $suffix = ' '.$matches[2];
                     }

--
Gitblit v1.9.1