Skip to content

Commit

Permalink
Continue scanning for ';' in broken parameter values even beyond a \r…
Browse files Browse the repository at this point in the history
… or \n
  • Loading branch information
jstedfast committed Aug 11, 2015
1 parent 157eca0 commit fc98384
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion MimeKit/ParameterList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ static bool TryParseNameValuePair (ParserOptions options, byte[] text, ref int i
// Note: Google Docs, for example, does not always quote name/filename parameters
// with spaces in the name. See https://github.com/jstedfast/MimeKit/issues/106
// for details.
while (index < endIndex && text[index] != (byte) ';' && text[index] != (byte) '\r' && text[index] != (byte) '\n')
while (index < endIndex && text[index] != (byte) ';')
index++;
}

Expand Down
2 changes: 1 addition & 1 deletion UnitTests/ContentDispositionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void TestMistakenlyQuotedEncodedParameterValues ()
[Test]
public void TestUnquotedFilenameParameterValues ()
{
const string text = "attachment; filename=Partnership Marketing Agreement Form - Mega Brands - Easter Toys - Week 11.pdf";
const string text = "attachment; filename=Partnership Marketing Agreement\n Form - Mega Brands - Easter Toys - Week 11.pdf";
ContentDisposition disposition;

Assert.IsTrue (ContentDisposition.TryParse (text, out disposition), "Failed to parse Content-Disposition");
Expand Down

0 comments on commit fc98384

Please sign in to comment.