Content-Type parameter values that contain only digits are ignored
------------------------------------------------------------------
Key: MIME4J-41
URL: https://issues.apache.org/jira/browse/MIME4J-41
Project: Mime4j
Issue Type: Bug
Affects Versions: 0.3, 0.4
Environment: Any
Reporter: Antony Bowesman
Fix For: 0.4, 0.3
Attachments: MessageTest.java
Parameter values in the Content-Type message header are ignored if they only
contain digits. This is a particular problem if a message contains an unquoted
boundary string that contains only digits, it is not recognised as a valid
boundary string and therefore the a Multipart object is created that fails the
Message.isMultipart() test.
Attached test case shows the problem
The ContentTypeParser.jj source for value parsing is
String value() :
{Token t;}
{
( t=<ATOKEN>
| t=<QUOTEDSTRING>
)
{ return t.image; }
}
however, if a value contains only digits, it is parsed as <DIGITS>, so will not
be assigned.
Sensible solution seems to be to change the value() implementation in JavaCC
source to include digit. Patch details
--- ContentTypeParser.jj 2007-05-25 02:04:09.000000000 +1000
+++ ContentTypeParserFix.jj 2008-03-19 08:44:14.109375000 +1100
@@ -122,6 +122,7 @@
{Token t;}
{
( t=<ATOKEN>
+| t=<DIGITS>
| t=<QUOTEDSTRING>
)
{ return t.image; }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]