Skip to content

Commit

Permalink
Port from CGI.pm: Fix multi-line header parsing.
Browse files Browse the repository at this point in the history
    This fix is covered by the tests in t/header.t added in the previous
    patch. If you run those tests without this patch, you'll see how the
    headers would be malformed without this fix.
  • Loading branch information
markstos committed Jan 17, 2010
1 parent b20c72f commit 87d77e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/CGI/Simple.pm
Expand Up @@ -1012,7 +1012,7 @@ sub header {

# Don't use \s because of perl bug 21951
next
unless my ( $header, $value ) = /([^ \r\n\t=]+)=\"?(.+?)\"?$/;
unless my ( $header, $value ) = /([^ \r\n\t=]+)=\"?(.+?)\"?$/s;
( $_ = $header )
=~ s/^(\w)(.*)/"\u$1\L$2" . ': '.$self->unescapeHTML($value)/e;
}
Expand Down

0 comments on commit 87d77e5

Please sign in to comment.