Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.0.0

Bug #9137 _hasUnclosedQuotes() doesn't properly handle a double slash before an end quote
Submitted: 2006-10-23 06:19 UTC
From: me at calebbrown dot id dot au Assigned: chagenbu
Status: Closed Package: Mail (version 1.1.14)
PHP Version: 4.3.11 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2006-10-23 06:19 UTC] me at calebbrown dot id dot au (Caleb Brown)
Description: ------------ When an email address such as '"John Doe\\" <text@example.com>' is passed to RFC822 to be validated _hasUnclosedQuotes() is detecting the '\"' at the end of the string and presumes that the quote has been escaped. Because it only finds a single opening quote it presumes that the string has unclosed quotes and thinks that the email address is invalid. Test script: --------------- <?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"; } } ?> Expected result: ---------------- "John Doe" <test@example.com> :: Parsed "John Doe\\" <test@example.com> :: Parsed Actual result: -------------- "John Doe" <test@example.com> :: Parsed "John Doe\\" <test@example.com> :: Failed to validate

Comments

 [2007-07-08 04:20 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2008-04-06 07:35 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2008-06-04 00:31 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2008-06-06 04:50 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!