Add unit test for EncodeQ [via SourceForge](https://sourceforge.net/p/phpmailer/bugs/341/)

Minor PHPDoc cleanup
This commit is contained in:
Synchro 2013-03-21 11:10:52 +01:00
parent 828c3e5827
commit 230e369b30
2 changed files with 20 additions and 5 deletions

View File

@ -2567,8 +2567,8 @@ class PHPMailer {
* $page->set('X-Priority', '3');
*
* @access public
* @param string $name Parameter Name
* @param mixed $value Parameter Value
* @param string $name
* @param mixed $value
* NOTE: will not work with arrays, there are no arrays to set/reset
* @throws phpmailerException
* @return bool
@ -2593,7 +2593,7 @@ class PHPMailer {
/**
* Strips newlines to prevent header injection.
* @access public
* @param string $str String
* @param string $str
* @return string
*/
public function SecureHeader($str) {
@ -2604,8 +2604,8 @@ class PHPMailer {
* Set the private key file and password to sign the message.
*
* @access public
* @param $cert_filename
* @param string $key_filename Parameter File Name
* @param string $cert_filename
* @param string $key_filename
* @param string $key_pass Password for private key
*/
public function Sign($cert_filename, $key_filename, $key_pass) {

View File

@ -1025,6 +1025,21 @@ EOT;
$this->Mail->ClearReplyTos();
}
/**
* Test address escaping
*/
function test_AddressEscaping()
{
$this->Mail->Subject .= ': Address escaping';
$this->Mail->ClearAddresses();
$this->Mail->AddAddress('foo@example.com', 'Tim "The Book" O\'Reilly');
$this->Mail->Body = 'Test correct escaping of quotes in addresses.';
$this->BuildBody();
$this->Mail->PreSend();
$b = $this->Mail->GetSentMIMEMessage();
$this->assertTrue((strpos($b, 'To: "Tim \"The Book\" O\'Reilly" <foo@example.com>') !==false));
}
/**
* Test BCC-only addressing
*/