Java Mailing List Archive

http://www.apache-httpd.com/

Home » modperl.perl »

Apache2::URI::unescape_url

Ryan Gies

2009-05-07

Replies: Find Java Web Hosting

Author LoginPost Reply
I'm rather surprised at what I'm seeing, but it appears this method
(Apache2::URI::unescape_url) is not correctly updating the length scalar
variable. Any thoughts? -Ryan

Output from the below response handler snippet:

Before: 'http%3A%2F%2Fexample.com'
After : 'http://example.com^@(protected)'

Alternate output (when url encoding the result):

Before: 'http%3A%2F%2Fexample.com'
After : 'http://example.com%00e.com/

--8<--------------------------------------------

package Apache2::Test::T1;
use strict;
use Apache2::URI;

sub handler {
my $r = shift;
$r->content_type('text/plain');
my $url = 'http%3A%2F%2Fexample.com';
$r->print(sprintf("Before: '%s'\n", $url));
Apache2::URI::unescape_url($url);
$r->print(sprintf("After : '%s'\n", $url));
Apache2::Const::OK;
}

1;

-------------------------------------------->8--
©2008 apache-httpd.com - Jax Systems, LLC, U.S.A.