/** * Gets the e-mail address details as a string. * @return string */ function ToDecodedString() { $result = ''; if ($this->Email != '') { $NewDisplayName = substr($this->DisplayName, 0, 2) != '=?' ? $this->DisplayName : ConvertUtils::DecodeHeaderString($this->DisplayName, $GLOBALS[MailInputCharset], $GLOBALS[MailOutputCharset]); $NewRemarks = substr($this->Remarks, 0, 2) != '=?' ? $this->Remarks : ConvertUtils::DecodeHeaderString($this->Remarks, $GLOBALS[MailInputCharset], $GLOBALS[MailOutputCharset]); if ($this->DisplayName != '' && $this->Remarks != '') { $result = sprintf('"%s" <%s> (%s)', $NewDisplayName, $this->Email, $NewRemarks); } elseif ($this->DisplayName != '') { $result = sprintf('"%s" <%s>', $NewDisplayName, $this->Email); } elseif ($this->Remarks != '') { $result = sprintf('%s (%s)', $this->Email, $NewRemarks); } else { $result = $this->Email; } } return $result; }
/** * @return string */ function GetDecodedValue() { return $this->IsParsed ? $this->Value : ConvertUtils::DecodeHeaderString($this->Value, $GLOBALS[MailInputCharset], $GLOBALS[MailOutputCharset], $this->IsWithParameters()); }