It seems that somewhere you pass two arguments to uri_escape. This I can't confirm, because I have no idea how Apache::Request's param function works. Normally, I'd read the manual and tell you, or read the source if the manual lacks information about the return type. However, Apache::Request is not pure perl and its documentation doesn't say clearly _how_ it returns values.

As long as you have this problem, it's probably better to take this script down, because if someone has an email address of foo@{[ `some nasty thing like rm -rf /` ]}, you're not going to like the results.

An alternative to URI::Escape's uri_escape is:

sub alt_uri_escape { my ($text) = @_; $text =~ s/([^A-Za-z0-9\-_.!~*'()])/sprintf "%%%02x", ord $1/ge; return $text; }
Please not that this differs in two ways. It doesn't take an optional second parameter to define your own range, and it doesn't use a hash lookup, which is a bit more efficient than this sprintf eval.

- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.


In reply to Re: incorrect use of URI::Escape? by Juerd
in thread incorrect use of URI::Escape? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.