Source for file AddressStructure.class.php
Documentation is available at AddressStructure.class.php
* AddressStructure.class.php
* This file contains functions needed to extract email address headers from
* @copyright 2003-2020 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: AddressStructure.class.php 14840 2020-01-07 07:42:38Z pdontthink $
* Class used to work with email address headers
* @todo check use of this variable. var is not used in class.
* @todo check use of this variable. var is not used in class.
* Return address information from mime headers.
* @param boolean $full return full address (true) or only personal if it exists, otherwise email (false)
* @param boolean $encoded (since 1.4.0) return rfc2047 encoded address (true) or plain text (false).
* @param boolean $unconditionally_quote (since 1.4.21/1.5.2) when TRUE, always quote the personal part, whether or not it is encoded, otherwise quoting is only added if the personal part is not encoded
function getAddress($full =
true, $encoded =
false, $unconditionally_quote =
FALSE) {
// FIXME: I don't think the U modifier below does anything at all
if (preg_match('/(=\?([^?]*)\?(Q|B)\?([^?]*)\?=)(.*)/Ui',$personal,$reg)) {
if ($encoded &&
!$is_encoded) {
if ($personal !==
$personal_encoded) {
$personal =
$personal_encoded;
//FIXME: this probably adds quotes around an encoded string which itself is already quoted
if (!$is_encoded ||
$unconditionally_quote) {
$addr =
($email ?
$personal .
' <' .
$email.
'>'
$result =
($full ?
$addr :
$best_dpl);
* Shorter version of getAddress() function
* Returns full encoded address.
* @param boolean $unconditionally_quote (since 1.4.21) when TRUE, always quote the personal part, whether or not it is encoded, otherwise quoting is only added if the personal part is not encoded
return $this->getAddress(true, true, $unconditionally_quote);
Documentation generated on Mon, 13 Jan 2020 04:24:13 +0100 by phpDocumentor 1.4.3