-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |