Zend Framework

method Zend_Mail_Protocol_Imap::_decodeLine() incorrectly parse some tokens

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9.3
  • Fix Version/s: 1.9.4
  • Component/s: Zend_Mail
  • Labels:
    None
  • Fix Version Priority:
    Should Have

Description

Try to parse (using Zend_Mail_Protocol_Imap::_decodeLine() ) the following line "* STATUS blurdybloop (MESSAGES 231 UNSEEN 0)", in the result you'll miss last "0" token. It's because of incorrect parsing of tokens in the following code fragment (file Zend/Mail/Protocol/Imap.php)

// only add if token had more than just closing braces
                if ($token) {
                    $tokens[] = $token;
                }

In input line above last token is "0" but expression "if ($token) {" treat it as numeric 0 and hence as a FALSE value. So instead of adding string "0" code ignores it.

Issue Links

Activity

Hide
Satoru Yoshida added a comment -

Sergei, I think following code, do you think? If "(some strings 0 )" would be passed, it seems to work fine.

if (rtrim($token) != '') {
    $tokens[] = rtrim($token);
}
Show
Satoru Yoshida added a comment - Sergei, I think following code, do you think? If "(some strings 0 )" would be passed, it seems to work fine.
if (rtrim($token) != '') {
    $tokens[] = rtrim($token);
}
Hide
Sergei Stolyarov added a comment -

Yes, it looks fine for me.

Show
Sergei Stolyarov added a comment - Yes, it looks fine for me.
Hide
Satoru Yoshida added a comment -

Thanks, solved at SVN r18498 in trunk

Show
Satoru Yoshida added a comment - Thanks, solved at SVN r18498 in trunk

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
1h
Original Estimate - 1 hour
Remaining:
1h
Remaining Estimate - 1 hour
Logged:
Not Specified
Time Spent - Not Specified