svn: /pear/packages/Mail/trunk/ Mail/RFC822.php tests/13659.phpt

From: Date: Mon, 08 Feb 2010 08:22:25 +0000
Subject: svn: /pear/packages/Mail/trunk/ Mail/RFC822.php tests/13659.phpt
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-58612@lists.php.net to get a copy of this message
clockwerx Mon, 08 Feb 2010 08:22:25 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=294749 Log: Bug #13659 - applied test / patch Bug: http://pear.php.net/bugs/13659 (unknown) Changed paths: U pear/packages/Mail/trunk/Mail/RFC822.php A pear/packages/Mail/trunk/tests/13659.phpt Modified: pear/packages/Mail/trunk/Mail/RFC822.php =================================================================== --- pear/packages/Mail/trunk/Mail/RFC822.php 2010-02-08 08:19:09 UTC (rev 294748) +++ pear/packages/Mail/trunk/Mail/RFC822.php 2010-02-08 08:22:25 UTC (rev 294749) @@ -646,8 +646,8 @@ $comment = $this->_splitCheck($parts, ')'); $comments[] = $comment; - // +1 is for the trailing ) - $_mailbox = substr($_mailbox, strpos($_mailbox, $comment)+strlen($comment)+1); + // +2 is for the brackets + $_mailbox = substr($_mailbox, strpos($_mailbox, '('.$comment)+strlen($comment)+2); } else { break; } Added: pear/packages/Mail/trunk/tests/13659.phpt =================================================================== --- pear/packages/Mail/trunk/tests/13659.phpt (rev 0) +++ pear/packages/Mail/trunk/tests/13659.phpt 2010-02-08 08:22:25 UTC (rev 294749) @@ -0,0 +1,25 @@ +--TEST-- +Mail: Test for bug #13659 +--FILE-- +<?php + +//require_once dirname(__FILE__) . '/../Mail/RFC822.php'; +require_once 'Mail/RFC822.php'; +require_once 'PEAR.php'; + +$address = '"Test Student" <test@mydomain.com> (test)'; +$result = Mail_RFC822::parseAddressList($address, 'anydomain.com', TRUE); + +if (!PEAR::isError($result) && is_array($result) && is_object($result[0])) + if ($result[0]->personal == '"Test Student"' && + $result[0]->mailbox == "test" && + $result[0]->host == "mydomain.com" && + is_array($result[0]->comment) && $result[0]->comment[0] == 'test') + { + print("OK"); + } + + +?> +--EXPECT-- +OK

« previous php.pear.cvs (#58612) next »