FreeBSD Bugzilla – Attachment 90688 Details for
Bug 127898
[patch] query-pr.cgi: properly treat quoted-printable line continuations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
0001-Implement-proper-quoted-printable-line-continuation.patch
0001-Implement-proper-quoted-printable-line-continuation.patch (text/plain), 2.01 KB, created by
Eygene Ryabinkin
on 2008-10-06 10:00:16 UTC
(
hide
)
Description:
0001-Implement-proper-quoted-printable-line-continuation.patch
Filename:
MIME Type:
Creator:
Eygene Ryabinkin
Created:
2008-10-06 10:00:16 UTC
Size:
2.01 KB
patch
obsolete
>From af39b0e8173c9fc76496f371a71666667719ade5 Mon Sep 17 00:00:00 2001 >From: Eygene Ryabinkin <rea-fbsd@codelabs.ru> >Date: Mon, 6 Oct 2008 12:32:28 +0400 > >Web interface for FreeBSD Gnats database treats quoted-printable in an >imcomplete way: it strips the trailing '=' signs, but does not join the >lines. > >This can be demonstrated by looking at the PR 126853, for example, > http://www.freebsd.org/cgi/query-pr.cgi?pr=126853 > >I had fixed this by detecting line continuations early and joining these >lines before they will be processed any further. So, now the code is >first assembling the whole continued line and only then is trying to >interpret/format it. > >Signed-off-by: Eygene Ryabinkin <rea-fbsd@codelabs.ru> >--- > query-pr.cgi | 18 ++++++++++++++++-- > 1 files changed, 16 insertions(+), 2 deletions(-) > mode change 100644 => 100755 query-pr.cgi > >diff --git a/query-pr.cgi b/query-pr.cgi >old mode 100644 >new mode 100755 >index 9dd376d..e6f0165 >--- a/query-pr.cgi >+++ b/query-pr.cgi >@@ -472,6 +472,7 @@ foreach my $field (@fields_multiple) > my $url = "${self_url_base}${PR}"; > > my $outp = ""; >+ my $qpcont = ""; > my %mime_headers; > my $mime_boundary; > my $mime_endheader; >@@ -594,6 +595,21 @@ foreach my $field (@fields_multiple) > if ($inresponse) { > my $txt = $1; > >+ # Detect Q-P line continuations, >+ # join them with the next line >+ # and process when the full line >+ # will be assembled. >+ if ($encoding == ENCODING_QP) { >+ if ($txt =~ /=$/) { >+ $txt =~ s/=$//; >+ $qpcont .= $txt; >+ next; >+ } else { >+ $txt = $qpcont . $txt; >+ $qpcont = ""; >+ } >+ } >+ > if ($txt !~ /^-+$/ && $txt !~ /(?:cut|snip)/i && $txt =~ /^--(\S+)$/) { > $mime_boundary = $1 if (!defined $mime_boundary && !$inpatch); > >@@ -658,8 +674,6 @@ foreach my $field (@fields_multiple) > $outp .= $txt; > next; > } elsif ($encoding == ENCODING_QP) { >- # XXX: lines ending in = should be joined >- $txt =~ s/=$//; > $txt = decode_qp($txt); > } > >-- >1.6.0.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 127898
: 90688