in reply to incorrect use of URI::Escape?
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:
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.sub alt_uri_escape { my ($text) = @_; $text =~ s/([^A-Za-z0-9\-_.!~*'()])/sprintf "%%%02x", ord $1/ge; return $text; }
- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: incorrect use of URI::Escape?
by tachyon (Chancellor) on Apr 13, 2002 at 18:13 UTC | |
by Juerd (Abbot) on Apr 13, 2002 at 18:27 UTC | |
by tachyon (Chancellor) on Apr 13, 2002 at 18:57 UTC | |
by Juerd (Abbot) on Apr 13, 2002 at 19:02 UTC |