in reply to Re: Re: Re: Re: How Internet is a mess. (Playing with HTTPD)
in thread How Internet is a mess. (Playing with HTTPD)
Hack this.
sub normalize_path { my ( $path ) = @_ ; return '' unless $path; # ensure that multiple %HH encoded stuff is decoded completely (know +n hack) 1 while $path =~ s/%([0-9a-fA-F]{2})/chr hex $1/ge; # get rid of those damn back slashes $path =~ s!\\+!/!g; # I don't see the need for many more chars than these # as the stated purpose is docs, not cgi ?;&= are # pointless, espacially as I just destroyed the query # string (potentially) if these are encoded with %HH $path =~ s![^\w \Q-?&;:,=./#\E]!!g; # fix ../ we don't have any \ left to fool us $path =~ s!\.\.?/!!g; # trim leading whitespace $path =~ s/^\s+//g; # allow single spaces for say Documents and Settings $path =~ s/ +/ /g; return $path ; }
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: Re: How Internet is a mess. (Playing with HTTPD)
by IlyaM (Parson) on Feb 28, 2003 at 09:42 UTC | |
by tachyon (Chancellor) on Feb 28, 2003 at 11:10 UTC | |
by IlyaM (Parson) on Feb 28, 2003 at 12:37 UTC | |
by Abigail-II (Bishop) on Feb 28, 2003 at 12:52 UTC | |
by IlyaM (Parson) on Feb 28, 2003 at 12:57 UTC | |
by tachyon (Chancellor) on Feb 28, 2003 at 12:48 UTC |