in reply to Re: Re: Re: Re: Re: Re: Re: Re: How Internet is a mess. (Playing with HTTPD)
in thread How Internet is a mess. (Playing with HTTPD)

That would consider
http://www.example.com/path/some/where?query/../here

to be unsafe. You might first want to split on a question mark, and then inspect just the first part.

Abigail

Replies are listed 'Best First'.
Re: Re: How Internet is a mess. (Playing with HTTPD)
by IlyaM (Parson) on Feb 28, 2003 at 12:57 UTC
    It is handled by URI module:
    use URI; my $uri = URI->new('http://www.example.com/path/some/where?query/../he +re'); print "Path: ", $uri->path, "\n"; print "Query: ", $uri->query, "\n"; __END__ Prints: Path: /path/some/where Query: query/../here

    --
    Ilya Martynov, ilya@iponweb.net
    CTO IPonWEB (UK) Ltd
    Quality Perl Programming and Unix Support UK managed @ offshore prices - http://www.iponweb.net
    Personal website - http://martynov.org