| Summary | MIME parsing breaks when boundary includes apostrophe |
| Queue | Horde Framework Packages |
| Queue Version | Git master |
| Type | Bug |
| State | Resolved |
| Priority | 1. Low |
| Owners | slusarz (at) horde (dot) org |
| Requester | spamstop1 (at) terriertech (dot) com |
| Created | 09/20/2014 (4067 days ago) |
| Due | |
| Updated | 09/24/2014 (4063 days ago) |
| Assigned | 09/24/2014 (4063 days ago) |
| Resolved | 09/24/2014 (4063 days ago) |
| Github Issue Link | |
| Github Pull Request | |
| Milestone | |
| Patch | No |
State ⇒ Resolved
commit dc54d1510227f35382715f4ade02f1644868d146
Author: Michael M Slusarz <slusarz@horde.org>
Date: Tue Sep 23 01:04:39 2014 -0600
[mms] Moved content parameter handling methods out of Horde_Mime
and into Horde_Mime_ContentParam.
[mms] Use string-based ABNF-based parser for scanning MIME
content parameters instead of a regular expression (
Bug #13587).framework/Mime/doc/Horde/Mime/UPGRADING | 17 +-
framework/Mime/lib/Horde/Mime.php | 316
+++-----------------
framework/Mime/lib/Horde/Mime/ContentParam.php | 280 +++++++++++++++++
.../Mime/lib/Horde/Mime/ContentParam/Decode.php | 103 +++++++
framework/Mime/lib/Horde/Mime/Headers.php | 17 +-
framework/Mime/package.xml | 20 ++-
.../test/Horde/Mime/ContentParam/DecodeTest.php | 78 +++++
.../Mime/test/Horde/Mime/ContentParamTest.php | 189 ++++++++++++
framework/Mime/test/Horde/Mime/MimeTest.php | 56 ----
9 files changed, 735 insertions(+), 341 deletions(-)
http://github.com/horde/horde/commit/dc54d1510227f35382715f4ade02f1644868d146
Assigned to Michael Slusarz
State ⇒ Assigned
Priority ⇒ 1. Low
the correct, ABNF string parsing method instead.
$splitRegex =
'/([^;\'"]*([\'"])((?:(?!\1).)+)(?1)[^;\'"]*|([^;]+))(;|$)/';
It fixed the problem.
I tried a few other phones and it didn't break anything on them, but I
don't have an extensive set of test messages to test with.
New Attachment: broken.txt
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ MIME parsing breaks when boundary includes apostrophe
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
The splitRegex (line 440 in Mime.php) seems to assume that apostrophes
will enclose a string and not occur within it. This means that the
"boundary=" parameter is stripped out of the Content-Type header when
it includes an apostrophe.
An example is attached.
The message body is OK, but since the boundary is missing from the
Content-Type header it shows up blank in most mail clients.