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 34193eef94323fdd73c715ad2d3c27adff02845e..956326dc180d06a7132862498743bd781ee3516c 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 4f80b0a4c790934627cad520255d4ef01d997af0..83763dfa3d9c3702d6ab0e4e31417befe848a609 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;
 }