Put quotes around both encoded and non-encoded addresses for consistency (#2449213)
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 1 Apr 2009 11:06:10 +0000 (11:06 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 1 Apr 2009 11:06:10 +0000 (11:06 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13493 7612ce4b-ef26-0410-bec9-ea0150e637f0

class/mime/AddressStructure.class.php
functions/identity.php

index 34193ee..956326d 100644 (file)
@@ -67,13 +67,13 @@ class AddressStructure {
                 if ($encoded && !$is_encoded) {
                     $personal_encoded = encodeHeader($personal);
                     if ($personal !== $personal_encoded) {
-                        $personal = $personal_encoded;
+                        $personal = '"' . $personal_encoded . '"';
                     } else {
-                        $personal = '"'.$this->personal.'"';
+                        $personal = '"' . $this->personal . '"';
                     }
                 } else {
                     if (!$is_encoded) {
-                        $personal = '"'.$this->personal.'"';
+                        $personal = '"' . $this->personal . '"';
                     }
                 }
                 $addr = ($email ? $personal . ' <' .$email.'>'
index 4f80b0a..83763df 100644 (file)
@@ -243,9 +243,9 @@ function build_from_header($identity = 0) {
     if ( isset($from_name) ) {
         $from_name_encoded = encodeHeader($from_name);
         if ($from_name_encoded != $from_name) {
-            return $from_name_encoded .' <'.$from_mail.'>';
+            return '"' . $from_name_encoded . '" <' . $from_mail . '>';
         }
-        return '"'.$from_name .'" <'.$from_mail.'>';
+        return '"' . $from_name . '" <' . $from_mail . '>';
     }
     return $from_mail;
 }