ZF-7547: Zend_Mail_Protocol_Imap::_decodeLine incorrectly parses some kind of strings
Description
For example, call $imap->_decodeLine('("A B C")') returns array('"A', 'B', 'C"') instead of array('"A B C"')
In the same time calls like $imap->_decodeLine('(X "A B C")') are working fine: array('X', '"A B C"')
$imap is an instance of Zend_Mail_Protocol_Imap (visibility modifier changed from protected to public for testing purposes).
This bug affects IMAP responses parsing and makes IMAP using almost impossible. For example, IMAP request like "FETCH 1 (ENVELOPE)" returns garbage instead of valid envelope.
Comments
Posted by Sergei Stolyarov (cancel) on 2009-08-10T05:04:22.000+0000
The problem could be saved by replacing line
if (preg_match('%^"((.|\\|\")*?)" *%', $line, $matches)) {
with
if (preg_match('%^("((.|\\|\")?)" *%', $line, $matches)) {
added '(*'
Posted by Sergei Stolyarov (cancel) on 2009-08-10T05:06:47.000+0000
proposed fix for Zend/Mail/Protocol/Imap.php
Posted by Satoru Yoshida (satoruyoshida) on 2009-08-19T07:00:22.000+0000
Memo: unit test Zend/Mail/ImapTest.php uses Zend/Mail/Protocol/Imap.php.
Posted by Benjamin Eberlei (beberlei) on 2009-09-18T02:41:25.000+0000
Moved to correct component
Posted by Satoru Yoshida (satoruyoshida) on 2009-11-14T06:17:16.000+0000
Solved in SVN r18976(trunk), r18977(1.9 branch)