*
* This file contains functions needed to handle headers in mime messages.
*
- * @copyright © 2003-2007 The SquirrelMail Project Team
+ * @copyright 2003-2009 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
$sComment = trim(implode(' ',$aComment));
$sPersonal .= $sComment;
}
- $oAddr =& new AddressStructure();
+ $oAddr = new AddressStructure();
if ($sPersonal && substr($sPersonal,0,2) == '=?') {
$oAddr->personal = encodeHeader($sPersonal);
} else {
$aAddrBookAddress = $this->parseAddress($aAddr['email'],true);
} else {
$iPosAt = strpos($aAddr['email'], '@');
- $oAddr->mailbox = substr($aAddr['email'], 0, $iPosAt);
- $oAddr->host = substr($aAddr['email'], $iPosAt+1);
+ if ($iPosAt === FALSE) {
+ $oAddr->mailbox = $aAddr['email'];
+ $oAddr->host = FALSE;
+ } else {
+ $oAddr->mailbox = substr($aAddr['email'], 0, $iPosAt);
+ $oAddr->host = substr($aAddr['email'], $iPosAt+1);
+ }
if (isset($aAddr['name'])) {
$oAddr->personal = $aAddr['name'];
} else {
if ($ar) {
return $aProcessedAddress;
} else {
- return $aProcessedAddress[0];
+ if (isset($aProcessedAddress[0]))
+ return $aProcessedAddress[0];
+ else
+ return '';
}
}
* @param boolean $encoded (since 1.4.0) return encoded or plain text addresses
* @return string
*/
- function getAddr_s($arr, $separator = ',',$encoded=false) {
+ function getAddr_s($arr, $separator = ', ', $encoded=false) {
$s = '';
if (is_array($arr)) {