Dear colleagues!

I have found that Apache::AutoIndex does not handle correctly filenames with
special symbols - whitespaces, <, > and so on.

The following patch solves the problem:

bash$ diff -U1 `pwd`/AutoIndex.pm
/usr/lib/perl5/site_perl/5.005/i386-linux/Apache/AutoIndex.pm
--- /usr/src/cpan/build/Apache-AutoIndex-0.08/AutoIndex.pm      Tue Jun 29
21:10:35 1999
+++ /usr/lib/perl5/site_perl/5.005/i386-linux/Apache/AutoIndex.pm       Thu
May 11 12:05:39 2000
@@ -6,3 +6,3 @@
 use DynaLoader ();
-use Apache::Util qw(ht_time size_string);
+use Apache::Util qw(ht_time size_string escape_uri);
 use Apache::ModuleConfig;
@@ -151,3 +151,3 @@
         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";
             }
@@ -223,3 +223,3 @@
         if ($cfg->{options} & ICONS_ARE_LINKS) {
-            print "<TD><a href=\"$entry";
+            print "<TD><a href=\"".escape_uri($entry);
                print "/" if $list->{$entry}{sizenice} eq '-';
@@ -232,3 +232,3 @@
         #Name
-        print "<TD><a href=\"$entry";
+        print "<TD><a href=\"".escape_uri($entry);
            print "/" if $list->{$entry}{sizenice} eq '-';

Thank you!

Sincerely,
Alexei

--
Alexei Barantsev, ISP RAS
E-mail: [EMAIL PROTECTED]
Phone : 912-53-17 (ex.4428)
ICQ   : 3959207

Reply via email to