Skip Menu |
 

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 33270
Status: resolved
Priority: 0/
Queue: libwww-perl

People
Owner: Nobody in particular
Requestors: ville.skytta [...] iki.fi
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 5.808
Fixed in: (no value)



Subject: Escape status line in error_as_HTML, convert to lowercase
Download (untitled) / with headers
text/plain 186b
The attached patch makes sure that the return value of status_line() will be HTML escaped, and converts the code to lowercase and adds missing <p> in order to make it valid XHTML strict.
Subject: htmlerror.patch
Download htmlerror.patch
text/x-diff 773b
Index: lib/HTTP/Response.pm =================================================================== RCS file: /cvsroot/libwww-perl/lwp5/lib/HTTP/Response.pm,v retrieving revision 1.53 diff -u -r1.53 Response.pm --- lib/HTTP/Response.pm 6 Dec 2005 13:19:09 -0000 1.53 +++ lib/HTTP/Response.pm 10 Feb 2008 21:50:37 -0000 @@ -121,17 +121,18 @@ sub error_as_HTML { + require HTML::Entities; my $self = shift; my $title = 'An Error Occurred'; - my $body = $self->status_line; + my $body = HTML::Entities::encode($self->status_line); return <<EOM; -<HTML> -<HEAD><TITLE>$title</TITLE></HEAD> -<BODY> -<H1>$title</H1> -$body -</BODY> -</HTML> +<html> +<head><title>$title</title></head> +<body> +<h1>$title</h1> +<p>$body</p> +</body> +</html> EOM }
Applied. Thanks!


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.