Skip to content

Commit

Permalink
[mms] Fix parsing a reply/forward subject with no blob content.
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Apr 16, 2014
1 parent 1d5d6b9 commit 3aa275f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Expand Up @@ -54,10 +54,6 @@ public function __construct($str, array $opts = array())
// Rule 1b: Remove superfluous whitespace.
$str = preg_replace("/[\t\r\n ]+/", ' ', $str);

if (!strlen($str)) {
$this->_subject = '';
}

do {
/* (2) Remove all trailing text of the subject that matches the
* the subj-trailer ABNF, repeat until no more matches are
Expand All @@ -82,7 +78,7 @@ public function __construct($str, array $opts = array())
* subj-fwd-trl and repeat from step (2). */
} while ($this->_removeSubjFwdHdr($str));

$this->_subject = $str;
$this->_subject = strval($str);
}

/**
Expand Down
2 changes: 2 additions & 0 deletions framework/Imap_Client/package.xml
Expand Up @@ -21,6 +21,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Fix parsing a reply/forward subject with no blob content.
* [mms] Ensure integer value returns from Horde_Imap_Client_Base#status() are truly integers.
</notes>
<contents>
Expand Down Expand Up @@ -2344,6 +2345,7 @@
<date>2014-04-02</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Fix parsing a reply/forward subject with no blob content.
* [mms] Ensure integer value returns from Horde_Imap_Client_Base#status() are truly integers.
</notes>
</release>
Expand Down
Expand Up @@ -38,7 +38,11 @@ public function provider()
array('Fwd: Re: Test (fwd)', 'Test'),
array(' re : Test (fwd)', 'Test'),
array(' re : [foo]Test(Fwd)', 'Test'),
array("re \t: \tTest", 'Test')
array("re \t: \tTest", 'Test'),
array('Re:', ''),
array(' RE : ', ''),
array('Fwd:', ''),
array(' FWD : ', '')
);
}

Expand Down

0 comments on commit 3aa275f

Please sign in to comment.