Skip to content

Commit

Permalink
Correctly reset pointer to end of stream if literal is not found
Browse files Browse the repository at this point in the history
Previously, pointer would have been set to closing literal bracket
  • Loading branch information
slusarz committed May 6, 2015
1 parent 8a137e7 commit 645a204
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions framework/Imap_Client/lib/Horde/Imap/Client/Tokenize.php
Expand Up @@ -182,9 +182,10 @@ public function flushIterator($return = true, $sublevel = true)
*/
public function getLiteralLength()
{
$this->_stream->end(-1);
if ($this->_stream->peek() === '}') {
$literal_data = $this->_stream->getString($this->_stream->search('{', true) - 1);
if ($this->_stream->substring(-1, 1) === '}') {
$literal_data = $this->_stream->getString(
$this->_stream->search('{', true) - 1
);
$literal_len = substr($literal_data, 2, -1);

if (is_numeric($literal_len)) {
Expand Down

0 comments on commit 645a204

Please sign in to comment.