MKGETDIR_PROTECT_INDEX now adds an htaccess file blocking the directory index instead of adding an index.htm

This commit is contained in:
steckbrief 2016-09-20 11:59:25 +02:00
parent 2d09635500
commit be3ad3bd19

View file

@ -140,12 +140,12 @@ function mkgetdir($dir, $flags=MKGETDIR_DEFAULT)
if( $flags&MKGETDIR_PROTECT_HTACCESS )
{
$file = $dir.'/.htaccess';
file_exists($file) or @file_put_contents( $file, 'deny from all' );
file_exists($file) or @file_put_contents( $file, 'DENY FROM all' );
}
if( $flags&MKGETDIR_PROTECT_INDEX )
{
$file = $dir.'/index.htm';
file_exists($file) or @file_put_contents( $file, 'Not allowed!' );
$file = $dir.'/.htaccess';
file_exists($file) or @file_put_contents( $file, 'Options -Indexes' );
}
}
if ( !is_writable($dir) )