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

Bug #18228 Improved string literals handling
Submitted: 2011-01-31 01:53 UTC
From: alec Assigned: yunosh
Status: Closed Package: Net_Sieve (version SVN)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    

 [2011-01-31 01:53 UTC] alec (Aleksander Machniak)
Description: ------------ This patch fixes a small issue in debug output of literal string in NO response. Before: S: NO {66} S: NO {66}line 107: error: syntax error, unexpected ']', expecting STRING. With patch applied: S: NO {66} S: line 107: error: syntax error, unexpected ']', expecting STRING. There're also small improvements in regular expressions used for finding literals in server responses (literal-s2c is only used, RFC5804).


 [2011-02-11 20:16 UTC] yunosh (Jan Schneider)
-Status: Open +Status: Feedback
Can you please create separate patches for those and explain why exactly you think they are necessary?
 [2011-02-11 20:47 UTC] alec (Aleksander Machniak)
The main change is necessary and it's explained in initial comment. There are also 3 expressions modified: 1. Regexp in _cmdGetScript(): '/^{[0-9]+}\r\n/' replaced by '/^{[0-9]+}\r\n/' Reason: {xx} here is always alone in the line. It should be faster this way. Also consider a script with "# {12}" text inside. 2. Regexp in _doCmd(): '/^{([0-9]+)\+?}/i' replaced by '/^{([0-9]+)}/i' Reason: This is for parsing server response. RFC5804 says that server responses uses only literal-s2c form which allows only numbers inside brackets (no "+" character here). BTW: /i also is not needed here, and should be removed.
 [2011-02-11 20:52 UTC] alec (Aleksander Machniak)
Example script for 1st regexp issue: if false header :contains "Subject" "test" { vacation :text reply {123} . ; }
 [2011-02-13 00:19 UTC] yunosh (Jan Schneider)
With that patch, the code runs amok if authentication fails. Looks like an infinite loop, but I haven't tracked it down so far.
 [2011-02-13 14:20 UTC] alec (Aleksander Machniak)
Works for me. I don't see a bug in the code. Debug log would be helpful. However we should add error checking on $this->_sock->read() result in _recvBytes().
 [2011-08-07 03:02 UTC] yunosh (Jan Schneider)
-Status: Feedback +Status: Closed -Assigned To: +Assigned To: yunosh
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at Turned out, this was a problem with PHPUnit not working correctly with PEAR_Errors.