[ 
https://issues.apache.org/jira/browse/TIKA-2044?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15954338#comment-15954338
 ] 

Wing-Hong Andrew Ko edited comment on TIKA-2044 at 4/3/17 11:45 PM:
--------------------------------------------------------------------

Hello!

In addition to incorrect handling of multi-line header values, the MboxParser 
code:
# allows content in the body of a message to override the header values
# has a "tracking" flag which seems to be intended for testing purposes only
# passes the full contents of the message in a stream to the 
{code}EmbeddedDocumentExtractor{code} as opposed to the body alone (as the 
{code}OutlookPSTParser{code} does)

May I submit a single PR with a refactor (and testing) for all of these issues?

Thanks!!
Andrew


was (Author: wko27):
Hello!

In addition to incorrect handling of multi-line header values, the MboxParser 
also allows content in the body of a message to override the header values.

May I submit a single PR with a refactor and unit tests for both issues?

Thanks!!
Andrew

> MboxParser wrongly concatenates multiple text lines into single header line
> ---------------------------------------------------------------------------
>
>                 Key: TIKA-2044
>                 URL: https://issues.apache.org/jira/browse/TIKA-2044
>             Project: Tika
>          Issue Type: Bug
>    Affects Versions: 1.13
>         Environment: Tika 1.13, and 1.14 nightly build at the time of this 
> writing
>            Reporter: Vjeran Marcinko
>
> MboxParser combines multiple text lines into single header value by 
> (suposedly) using LIFO structure (stack - java deque), but instead it uses 
> FIFO (queue) to fetch last inserted line and to extend it with current line 
> in incorrect way:
> Current code:
> Queue<String> multiline = new LinkedList<String>();
> ... few lines below...
> String latestLine = multiline.poll();
> Whereas it should be:
> Deque<String> multiline = new LinkedList<String>();
> ... few lines below...
> String latestLine = multiline.pollLast();



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to