X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=class%2Fmime%2FAddressStructure.class.php;h=956326dc180d06a7132862498743bd781ee3516c;hb=3ba5c6063eb9282838b862d4f206266d0034e905;hp=165607f70ad8d2ce6589a2977019cff844b19af5;hpb=6c99d1de81366bceab6c9d6cf12179eedc81f9bc;p=squirrelmail.git diff --git a/class/mime/AddressStructure.class.php b/class/mime/AddressStructure.class.php index 165607f7..956326dc 100644 --- a/class/mime/AddressStructure.class.php +++ b/class/mime/AddressStructure.class.php @@ -6,7 +6,7 @@ * This file contains functions needed to extract email address headers from * mime messages. * - * @copyright © 2003-2006 The SquirrelMail Project Team + * @copyright © 2003-2007 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail @@ -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.'>' @@ -97,4 +97,17 @@ class AddressStructure { function getEncodedAddress() { return $this->getAddress(true, true); } + + /** + * Return just the email portion of this address + * @return string + * @since 1.5.2 + */ + function getEmail () { + $r = ''; + if (is_object($this)) { + $r = $this->host ? $this->mailbox.'@'.$this->host : $this->mailbox; + } + return $r; + } }