squirrelmail-webmail  1.4.22
About: SquirrelMail is a standards-based webmail package with strong MIME support, address books, and folder manipulation (written in PHP4).
  Fossies Dox: squirrelmail-webmail-1.4.22.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

AddressStructure.class.php
Go to the documentation of this file.
1 <?php
2 
28  var $personal = '';
33  var $adl = '';
38  var $mailbox = '';
43  var $host = '';
48  var $group = '';
49 
57  function getAddress($full = true, $encoded = false, $unconditionally_quote = FALSE) {
58  $result = '';
59  if (is_object($this)) {
60  $email = ($this->host ? $this->mailbox.'@'.$this->host
61  : $this->mailbox);
62  $personal = trim($this->personal);
63  $is_encoded = false;
64  // FIXME: I don't think the U modifier below does anything at all
65  if (preg_match('/(=\?([^?]*)\?(Q|B)\?([^?]*)\?=)(.*)/Ui',$personal,$reg)) {
66  $is_encoded = true;
67  }
68  if ($personal) {
69  if ($encoded && !$is_encoded) {
70  $personal_encoded = encodeHeader('"' . $personal . '"');
71  if ($personal !== $personal_encoded) {
72  $personal = $personal_encoded;
73  } else {
74  //FIXME: this probably adds quotes around an encoded string which itself is already quoted
75  $personal = '"'.$this->personal.'"';
76  }
77  } else {
78  if (!$is_encoded || $unconditionally_quote) {
79  $personal = '"'.$this->personal.'"';
80  }
81  }
82  $addr = ($email ? $personal . ' <' .$email.'>'
83  : $this->personal);
84  $best_dpl = $this->personal;
85  } else {
86  $addr = $email;
87  $best_dpl = $email;
88  }
89  $result = ($full ? $addr : $best_dpl);
90  }
91  return $result;
92  }
93 
101  function getEncodedAddress($unconditionally_quote=FALSE) {
102  return $this->getAddress(true, true, $unconditionally_quote);
103  }
104 }
105 
AddressStructure
Definition: AddressStructure.class.php:23
AddressStructure\getEncodedAddress
getEncodedAddress($unconditionally_quote=FALSE)
Definition: AddressStructure.class.php:101
AddressStructure\$group
$group
Definition: AddressStructure.class.php:48
AddressStructure\$personal
$personal
Definition: AddressStructure.class.php:28
AddressStructure\getAddress
getAddress($full=true, $encoded=false, $unconditionally_quote=FALSE)
Definition: AddressStructure.class.php:57
encodeHeader
encodeHeader($string)
Definition: mime.php:759
AddressStructure\$mailbox
$mailbox
Definition: AddressStructure.class.php:38
AddressStructure\$adl
$adl
Definition: AddressStructure.class.php:33
AddressStructure\$host
$host
Definition: AddressStructure.class.php:43