Skip to content

Commit

Permalink
Add unit test for EncodeQ [via SourceForge](https://sourceforge.net/p…
Browse files Browse the repository at this point in the history
…/phpmailer/bugs/341/)

Minor PHPDoc cleanup
  • Loading branch information
Synchro committed Mar 21, 2013
1 parent 828c3e5 commit 230e369
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
10 changes: 5 additions & 5 deletions class.phpmailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2567,8 +2567,8 @@ public static function _mime_types($ext = '') {
* $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
Expand All @@ -2593,7 +2593,7 @@ public function set($name, $value = '') {
/**
* Strips newlines to prevent header injection.
* @access public
* @param string $str String
* @param string $str
* @return string
*/
public function SecureHeader($str) {
Expand All @@ -2604,8 +2604,8 @@ public function SecureHeader($str) {
* 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) {
Expand Down
15 changes: 15 additions & 0 deletions test/phpmailerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,21 @@ function test_Addressing()
$this->Mail->ClearReplyTos();
}

/**
* Test address escaping
*/
function test_AddressEscaping()
{
$this->Mail->Subject .= ': Address escaping';
$this->Mail->ClearAddresses();
$this->Mail->AddAddress('[email protected]', '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" <[email protected]>') !==false));
}

/**
* Test BCC-only addressing
*/
Expand Down

0 comments on commit 230e369

Please sign in to comment.