import v1.1.0_beta1 | 2009-08-21

This commit is contained in:
2019-07-17 22:16:19 +02:00
parent 2c1152f0d3
commit 8dee6b1a10
2306 changed files with 251360 additions and 23428 deletions

View File

@ -16,7 +16,7 @@
* @package Zend_Mail
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Part.php 12519 2008-11-10 18:41:24Z alexander $
* @version $Id: Part.php 13591 2009-01-11 09:04:09Z beberlei $
*/
@ -337,14 +337,14 @@ class Zend_Mail_Part implements RecursiveIterator, Zend_Mail_Part_Interface
$lowerName = strtolower($name);
if (!isset($this->_headers[$lowerName])) {
if ($this->headerExists($name) == false) {
$lowerName = strtolower(preg_replace('%([a-z])([A-Z])%', '\1-\2', $name));
if (!isset($this->_headers[$lowerName])) {
if($this->headerExists($lowerName) == false) {
/**
* @see Zend_Mail_Exception
*/
require_once 'Zend/Mail/Exception.php';
throw new Zend_Mail_Exception("no Header with Name $name found");
throw new Zend_Mail_Exception("no Header with Name $name or $lowerName found");
}
}
$name = $lowerName;
@ -365,6 +365,22 @@ class Zend_Mail_Part implements RecursiveIterator, Zend_Mail_Part_Interface
return $header;
}
/**
* Check wheater the Mail part has a specific header.
*
* @param string $name
* @return boolean
*/
public function headerExists($name)
{
$name = strtolower($name);
if(isset($this->_headers[$name])) {
return true;
} else {
return false;
}
}
/**
* Get a specific field from a header like content type or all fields as array
@ -402,6 +418,21 @@ class Zend_Mail_Part implements RecursiveIterator, Zend_Mail_Part_Interface
return $this->getHeader($name, 'string');
}
/**
* Isset magic method proxy to hasHeader
*
* This method is short syntax for Zend_Mail_Part::hasHeader($name);
*
* @see Zend_Mail_Part::hasHeader
*
* @param string
* @return boolean
*/
public function __isset($name)
{
return $this->headerExists($name);
}
/**
* magic method to get content of part
*