You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Mark Hedges <Ma...@Ticketmaster.com> on 2014/06/27 02:42:42 UTC

Apache2::URI::unescape_url bug?

Try in a handler.  (Apparently you cannot use Apache2::URI from command line?)

use Apache2::Log ();
use Apache2::URI ();
sub handler {
    my ($r) = @_;
    my $string = "6%2D41913%2FUK1";
    Apache2::URI::unescape($string);
    $r->log_error($string);
}

Log contains: 6-41913/UK1\0UK1

??

-Mark

Re: Apache2::URI::unescape_url bug?

Posted by Cees Hek <ce...@gmail.com>.
Hi Mark,

I think the problem that David is having is that you were not very clear in
your message what the problem was.  It might have been helpful to show the
output, plus your expected output:

Log contains: 6-41913/UK1\0UK1

But I expected this: 6-41913/UK1

Unfortunately I don't have anything more to contribute except that it does
look like a bug.

Cheers,

Cees


On Sat, Jun 28, 2014 at 3:12 AM, Mark Hedges <Ma...@ticketmaster.com>
wrote:

> The intent was to report that Apache2::URI::unescape does not seem to work
> correctly.
>
> Mark
>
> -----Original Message-----
> From: David Booth [mailto:david@dbooth.org]
> Sent: Thursday, June 26, 2014 8:43 PM
> To: modperl@perl.apache.org
> Subject: Re: Apache2::URI::unescape_url bug?
>
> On 06/26/2014 08:42 PM, Mark Hedges wrote:
> > Try in a handler.  (Apparently you cannot use Apache2::URI from command
> line?)
> >
> > use Apache2::Log ();
> > use Apache2::URI ();
> > sub handler {
> >      my ($r) = @_;
> >      my $string = "6%2D41913%2FUK1";
> >      Apache2::URI::unescape($string);
> >      $r->log_error($string);
> > }
> >
> > Log contains: 6-41913/UK1\0UK1
> >
> > ??
>
> Not sure what is the intent of your question/comment, but I often use
> uri_unescape in URI::Escape and it seems to work fine.
>
> David
>
>

Re: Apache2::URI::unescape_url bug?

Posted by Vincent Veyron <vv...@wanadoo.fr>.
On Sun, 29 Jun 2014 17:36:43 +0000
Mark Hedges <Ma...@Ticketmaster.com> wrote:

> Another library providing the same function in working order is not a reason to not fix the function in Apache2::URI.
> 

I was wondering why Apache2::URI exists in the first place, since one can use an already existant module?

> s/b Apache2::URI::unescape_url()... [...]
> 

I don't get this

P.S. : please don't top-post

-- 
					Salutations, Vincent Veyron

http://marica.fr/
Gestion des contentieux, des dossiers de sinistres assurance et des contrats pour le service juridique

RE: Apache2::URI::unescape_url bug?

Posted by Mark Hedges <Ma...@Ticketmaster.com>.
Another library providing the same function in working order is not a reason to not fix the function in Apache2::URI.

s/b Apache2::URI::unescape_url()... [...]

Mark


-----Original Message-----
From: Vincent Veyron [mailto:vv.lists@wanadoo.fr] 
Sent: Saturday, June 28, 2014 7:02 AM
To: Mark Hedges
Cc: modperl@perl.apache.org
Subject: Re: Apache2::URI::unescape_url bug?

On Fri, 27 Jun 2014 17:12:35 +0000
Mark Hedges <Ma...@Ticketmaster.com> wrote:

> The intent was to report that Apache2::URI::unescape does not seem to work correctly.
> 

This is what I get when I try your code :

Undefined subroutine &Apache2::URI::unescape called at /home/lib/Carnet/bla.pm line 35.\n

I don't see unescape in the list of functions in the doc :

http://perl.apache.org/docs/2.0/api/Apache2/URI.html

Is there a particular reason to use Apache2::URI in mod_perl?

use URI::Escape();

sub handler {
    my ($r) = @_;
    my $string = "6%2D41913%2FUK1";
    my $test = URI::Escape::uri_unescape($string);
    $r->log_error($test);
}

Result:

[Sat Jun 28 15:50:06 2014] [error] 6-41913/UK1

Note the $test variable I added; your code with URI::Escape :

sub handler {
    my ($r) = @_;
    my $string = "6%2D41913%2FUK1";
    URI::Escape::uri_unescape($string);
    $r->log_error($string);
}

Result:

[Sat Jun 28 15:54:44 2014] [error] 6%2D41913%2FUK1

-- 
					Salutations, Vincent Veyron

http://vincentveyron.com

Re: Apache2::URI::unescape_url bug?

Posted by Vincent Veyron <vv...@wanadoo.fr>.
On Fri, 27 Jun 2014 17:12:35 +0000
Mark Hedges <Ma...@Ticketmaster.com> wrote:

> The intent was to report that Apache2::URI::unescape does not seem to work correctly.
> 

This is what I get when I try your code :

Undefined subroutine &Apache2::URI::unescape called at /home/lib/Carnet/bla.pm line 35.\n

I don't see unescape in the list of functions in the doc :

http://perl.apache.org/docs/2.0/api/Apache2/URI.html

Is there a particular reason to use Apache2::URI in mod_perl?

use URI::Escape();

sub handler {
    my ($r) = @_;
    my $string = "6%2D41913%2FUK1";
    my $test = URI::Escape::uri_unescape($string);
    $r->log_error($test);
}

Result:

[Sat Jun 28 15:50:06 2014] [error] 6-41913/UK1

Note the $test variable I added; your code with URI::Escape :

sub handler {
    my ($r) = @_;
    my $string = "6%2D41913%2FUK1";
    URI::Escape::uri_unescape($string);
    $r->log_error($string);
}

Result:

[Sat Jun 28 15:54:44 2014] [error] 6%2D41913%2FUK1

-- 
					Salutations, Vincent Veyron

http://vincentveyron.com

Re: Apache2::URI::unescape_url bug?

Posted by Vincent Veyron <vi...@wanadoo.fr>.
On Fri, 27 Jun 2014 17:12:35 +0000
Mark Hedges <Ma...@Ticketmaster.com> wrote:

> The intent was to report that Apache2::URI::unescape does not seem to work correctly.
> 

This is what I get when I try your code :

Undefined subroutine &Apache2::URI::unescape called at /home/lib/Carnet/bla.pm line 35.\n

I don't see unescape in the list of functions in the doc :

http://perl.apache.org/docs/2.0/api/Apache2/URI.html

Is there a particular reason to use Apache2::URI in mod_perl?

use URI::Escape();

sub handler {
    my ($r) = @_;
    my $string = "6%2D41913%2FUK1";
    my $test = URI::Escape::uri_unescape($string);
    $r->log_error($test);
}

Result:

[Sat Jun 28 15:50:06 2014] [error] 6-41913/UK1

Note the $test variable I added; your code with URI::Escape :

sub handler {
    my ($r) = @_;
    my $string = "6%2D41913%2FUK1";
    URI::Escape::uri_unescape($string);
    $r->log_error($string);
}

Result:

[Sat Jun 28 15:54:44 2014] [error] 6%2D41913%2FUK1

-- 
					Salutations, Vincent Veyron

http://vincentveyron.com

RE: Apache2::URI::unescape_url bug?

Posted by Mark Hedges <Ma...@Ticketmaster.com>.
The intent was to report that Apache2::URI::unescape does not seem to work correctly.

Mark

-----Original Message-----
From: David Booth [mailto:david@dbooth.org] 
Sent: Thursday, June 26, 2014 8:43 PM
To: modperl@perl.apache.org
Subject: Re: Apache2::URI::unescape_url bug?

On 06/26/2014 08:42 PM, Mark Hedges wrote:
> Try in a handler.  (Apparently you cannot use Apache2::URI from command line?)
>
> use Apache2::Log ();
> use Apache2::URI ();
> sub handler {
>      my ($r) = @_;
>      my $string = "6%2D41913%2FUK1";
>      Apache2::URI::unescape($string);
>      $r->log_error($string);
> }
>
> Log contains: 6-41913/UK1\0UK1
>
> ??

Not sure what is the intent of your question/comment, but I often use 
uri_unescape in URI::Escape and it seems to work fine.

David


Re: Apache2::URI::unescape_url bug?

Posted by David Booth <da...@dbooth.org>.
On 06/26/2014 08:42 PM, Mark Hedges wrote:
> Try in a handler.  (Apparently you cannot use Apache2::URI from command line?)
>
> use Apache2::Log ();
> use Apache2::URI ();
> sub handler {
>      my ($r) = @_;
>      my $string = "6%2D41913%2FUK1";
>      Apache2::URI::unescape($string);
>      $r->log_error($string);
> }
>
> Log contains: 6-41913/UK1\0UK1
>
> ??

Not sure what is the intent of your question/comment, but I often use 
uri_unescape in URI::Escape and it seems to work fine.

David