default autoindex script

#1
The default autoindex script gives the wrong url in the HREF= "foo", to correct that apply this patch:-

--- default.php.orig 2005-05-07 15:26:27.000000000 +0100
+++ default.php 2005-05-07 15:26:34.000000000 +0100
@@ -171,7 +171,7 @@
function printOneEntry( $base, $name, $fileStat, $setting )
{
$buf = '<img SRC="' . $setting->IconPath . '/' . $fileStat->img->imageName .
- '" ALT="' . $fileStat->img->alt . '"> <A HREF="' . $base . $fileStat->name.$fileStat->isdir.'">';
+ '" ALT="' . $fileStat->img->alt . '"> <A HREF="' . $fileStat->name.$fileStat->isdir.'">';
if ( strlen( $name ) > $setting->nameWidth )
{
$name = substr( $name, 0, $setting->nameWidth - 3 ). '...';


Whilst I am about it, it would be nice to be able to select which index script I use on a server level. I cannot find a screen with a slot for that. I know I can select it on a virtual server basis (but why a URI and not a path when the default obviously uses a path)?
 

mistwang

LiteSpeed Staff
#2
Thank you for the patch, will apply it.

We can add server level configuration. Actaully, you can just modify the default script, it affects all vhosts, and creat a specific one for one vhost when needed.

The reason we use URI not path is for security reason, it makes sure that only scripts available to vhost can be used.
 

mistwang

LiteSpeed Staff
#3
Your patch does not fix the problem completely,
The correct fix should be replacing all "PHP_SELF" with "REQUEST_URI".

"PHP_SELF" was the same value as "REQUEST_URI" before 2.0.4 release.
 
Top