Skip to content

Commit

Permalink
Test for bug 9137
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.php.net/repository/pear/packages/Mail/trunk@239269 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
Chuck Hagenbuch committed Jul 8, 2007
1 parent 9a428dc commit 42e2254
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/9137.phpt
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,30 @@
--TEST--
Mail: Test for bug #9137
--FILE--
<?php

require_once 'Mail/RFC822.php';
require_once 'PEAR.php';

$addresses = array(
array('name' => 'John Doe', 'email' => 'test@example.com'),
array('name' => 'John Doe\\', 'email' => 'test@example.com'),
);

for ($i = 0; $i < count($addresses); $i++) {
// construct the address
$address = "\"" . addslashes($addresses[$i]['name']) . "\" ".
"<".$addresses[$i]['email'].">";

$parsedAddresses = Mail_RFC822::parseAddressList($address);

if (PEAR::isError($parsedAddresses)) {
echo $address." :: Failed to validate\n";
} else {
echo $address." :: Parsed\n";
}
}

--EXPECT--
"John Doe" <test@example.com> :: Parsed
"John Doe\\" <test@example.com> :: Parsed

0 comments on commit 42e2254

Please sign in to comment.