Submit
Path:
~
/
/
opt
/
cloudlinux
/
alt-php55
/
root
/
usr
/
share
/
pear
/
test
/
Mail
/
tests
/
File Content:
9137_2.phpt
--TEST-- Mail: Test for bug #9137, take 2 --FILE-- <?php require_once dirname(__FILE__) . '/../Mail/RFC822.php'; require_once 'PEAR.php'; $addresses = array( array('raw' => '"John Doe" <test@example.com>'), array('raw' => '"John Doe' . chr(92) . '" <test@example.com>'), array('raw' => '"John Doe' . chr(92) . chr(92) . '" <test@example.com>'), array('raw' => '"John Doe' . chr(92) . chr(92) . chr(92) . '" <test@example.com>'), array('raw' => '"John Doe' . chr(92) . chr(92) . chr(92) . chr(92) . '" <test@example.com>'), array('raw' => '"John Doe <test@example.com>'), ); for ($i = 0; $i < count($addresses); $i++) { // construct the address $address = $addresses[$i]['raw']; $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> :: Failed to validate "John Doe\\" <test@example.com> :: Parsed "John Doe\\\" <test@example.com> :: Failed to validate "John Doe\\\\" <test@example.com> :: Parsed "John Doe <test@example.com> :: Failed to validate
Submit
FILE
FOLDER
Name
Size
Permission
Action
13659.phpt
649 bytes
0644
9137.phpt
1001 bytes
0644
9137_2.phpt
1226 bytes
0644
bug17178.phpt
228 bytes
0644
bug17317.phpt
421 bytes
0644
rfc822.phpt
2849 bytes
0644
smtp_error.phpt
755 bytes
0644
N4ST4R_ID | Naxtarrr