Ken Williams <[EMAIL PROTECTED]> writes:
> [EMAIL PROTECTED] (Alexei V. Barantsev) wrote:
> > Dear modperlers!
> >
> >I have found that Apache::Autoindex dos not like filenames with
> >special characters (like space or ?). Such a name should be
> >uri-escaped. See patch below.
>
> This patch is backwards, it should be done the other way around. '+' should be
> next to the new lines.
>
Sorry! I was dumb.
(19:25:34) $ diff -u AutoIndex.pm-orig AutoIndex.pm
--- AutoIndex.pm-orig Tue Jun 29 21:10:35 1999
+++ AutoIndex.pm Thu May 11 12:05:39 2000
@@ -4,7 +4,7 @@
use strict;
use Apache::Constants qw(:common OPT_INDEXES DECLINE_CMD REDIRECT DIR_MAGIC_TYPE);
use DynaLoader ();
-use Apache::Util qw(ht_time size_string);
+use Apache::Util qw(ht_time size_string escape_uri);
use Apache::ModuleConfig;
use Apache::Icon;
use Apache::Language;
@@ -149,7 +149,7 @@
if (not $cfg->{options} & FANCY_INDEXING){
print "<UL>\n";
foreach my $file ( readdir DH ){
- print "\t<LI><A HREF=\"$file\">$file</A></LI>\n";
+ print "\t<LI><A HREF=\"".escape_uri($file)."\">$file</A></LI>\n";
}
print "</UL></BODY></HTML>\n";
return OK;
@@ -221,7 +221,7 @@
#Icon
print "<TD>";
if ($cfg->{options} & ICONS_ARE_LINKS) {
- print "<TD><a href=\"$entry";
+ print "<TD><a href=\"".escape_uri($entry);
print "/" if $list->{$entry}{sizenice} eq '-';
print "\">";
}
@@ -230,7 +230,7 @@
print "</TD>";
#Name
- print "<TD><a href=\"$entry";
+ print "<TD><a href=\"".escape_uri($entry);
print "/" if $list->{$entry}{sizenice} eq '-';
print "\">$label</a></TD>";
--
ab
ICQ: 3959207