Zend Framework

Zend_Mail_Protocol_Imap::_decodeLine incorrectly parses some kind of strings

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9.0
  • Fix Version/s: 1.9.6
  • Component/s: Zend_Mail_Storage
  • Labels:
    None

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.

Issue Links

Activity

Hide
Sergei Stolyarov added a comment -

The problem could be saved by replacing line

if (preg_match('%^"((.|\\\\|
")*?)" *%', $line, $matches)) {

with

if (preg_match('%^("((.|\\\\|
")
?)" *%', $line, $matches)) {

added '(*'

Show
Sergei Stolyarov added a comment - The problem could be saved by replacing line if (preg_match('%^"((.|\\\\|
")*?)" *%', $line, $matches)) { with if (preg_match('%^("((.|\\\\|
")
?)" *%', $line, $matches)) { added '(*'
Hide
Sergei Stolyarov added a comment -

proposed fix for Zend/Mail/Protocol/Imap.php

Show
Sergei Stolyarov added a comment - proposed fix for Zend/Mail/Protocol/Imap.php
Hide
Satoru Yoshida added a comment -

Memo: unit test Zend/Mail/ImapTest.php uses Zend/Mail/Protocol/Imap.php.

Show
Satoru Yoshida added a comment - Memo: unit test Zend/Mail/ImapTest.php uses Zend/Mail/Protocol/Imap.php.
Hide
Benjamin Eberlei added a comment -

Moved to correct component

Show
Benjamin Eberlei added a comment - Moved to correct component
Hide
Satoru Yoshida added a comment -

Solved in SVN r18976(trunk), r18977(1.9 branch)

Show
Satoru Yoshida added a comment - Solved in SVN r18976(trunk), r18977(1.9 branch)

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: