FAQ
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

Search Discussions

  • David Booth at Jun 27, 2014 at 3:43 am

    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
  • Mark Hedges at Jun 27, 2014 at 5:13 pm
    The intent was to report that Apache2::URI::unescape does not seem to work correctly.

    Mark

    -----Original Message-----
    From: David Booth
    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
  • Cees Hek at Jun 28, 2014 at 12:05 am
    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 wrote:

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

    Mark

    -----Original Message-----
    From: David Booth
    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
  • Vincent Veyron at Jun 28, 2014 at 2:02 pm

    On Fri, 27 Jun 2014 17:12:35 +0000 Mark Hedges 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
  • Mark Hedges at Jun 29, 2014 at 5:37 pm
    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
    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 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
  • Vincent Veyron at Jun 29, 2014 at 8:15 pm

    On Sun, 29 Jun 2014 17:36:43 +0000 Mark Hedges 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
  • Vincent Veyron at Jun 28, 2014 at 4:51 pm

    On Fri, 27 Jun 2014 17:12:35 +0000 Mark Hedges 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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmodperl @
categoriesmodperl, perl
postedJun 27, '14 at 12:43a
activeJun 29, '14 at 8:15p
posts8
users5
websiteperl.apache.org

People

Translate

site design / logo © 2018 Grokbase