default autoindex script

Discussion in 'Bug Reports' started by djkoopman, May 7, 2005.

  1. djkoopman

    djkoopman New Member

    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)?
  2. mistwang

    mistwang LiteSpeed Staff

    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.
  3. mistwang

    mistwang LiteSpeed Staff

    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.

Share This Page