Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update regex for return path to allow for a single quote to be includ… #86

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./tests/bootstrap.php" colors="true" beStrictAboutTestsThatDoNotTestAnything="false">
<phpunit bootstrap="./tests/bootstrap.php" colors="true" beStrictAboutTestsThatDoNotTestAnything="false" cacheResult="false">
<testsuites>
<testsuite name="Zeta Components Mail">
<directory suffix="_test.php">./tests</directory>
Expand Down
2 changes: 1 addition & 1 deletion src/mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class ezcMail extends ezcMailPart
/**
* Characters allowed in the returnPath address
*/
const RETURN_PATH_CHARS = 'A-Za-z0-9_.@=/+{}#~-';
const RETURN_PATH_CHARS = 'A-Za-z0-9_.@=/+{}#~\-\'';

/**
* Holds the options for this class.
Expand Down
2 changes: 1 addition & 1 deletion tests/composer_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ezcMailComposerTest extends ezcTestCase
{
private $mail;

protected function setUp()
protected function setUp(): void
{
$this->mail = new ezcMailComposer();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/interfaces/part_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ezcMailPartTest extends ezcTestCase
{
private $part;

protected function setUp()
protected function setUp(): void
{
$this->part = new MailPartTest();
}
Expand Down
9 changes: 8 additions & 1 deletion tests/mail_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ezcMailTest extends ezcTestCase
{
private $mail;

protected function setUp()
protected function setUp(): void
{
$this->mail = new ezcMail();
}
Expand Down Expand Up @@ -507,6 +507,13 @@ public function testEmptyReturnPath()
$this->assertNull( $mail->returnPath );
}

public function testSingleQuoteReturnPath()
{
$mail = new ezcMail();
$mail->returnPath = new ezcMailAddress( 'TestEmailWith\'singlequote@example.com' );
$this->assertEquals( 'TestEmailWith\'singlequote@example.com', $mail->returnPath->email );
}

public function testInvalidReturnPathChars()
{
$mail = new ezcMail();
Expand Down
2 changes: 1 addition & 1 deletion tests/parts/multipart_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class ezcMailMultipartTest extends ezcTestCase
{
private $multipart;

protected function setUp()
protected function setUp(): void
{
$this->multipart = new TestMultipart();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/parts/text_part_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ezcMailTextTest extends ezcTestCase
{
private $part;

protected function setUp()
protected function setUp(): void
{
$this->part = new ezcMailText( "dummy" );
}
Expand Down