PHP bağlayıcı koduna baktığımızda, bunu değiştirmek istiyorum:
// All files
foreach( $files as $file ) {
if( file_exists($root . $_POST['dir'] . $file) && $file != '.' && $file != '..' && !is_dir($root . $_POST['dir'] . $file) ) {
$ext = preg_replace('/^.*\./', '', $file);
echo "<li class=\"file ext_$ext\"><a href=\"#\" rel=\"" . htmlentities($_POST['dir'] . $file) . "\">" . htmlentities($file) . "</a></li>";
}
}
Bu grubu:
// All files
foreach( $files as $file ) {
if( file_exists($root . $_POST['dir'] . $file) && $file != '.' && $file != '..' && !is_dir($root . $_POST['dir'] . $file) ) {
$parts = explode(".", $file);
$ext = array_pop($parts);
$name = implode(".", $parts);
echo "<li class=\"file ext_$ext\"><a href=\"#\" rel=\"" . htmlentities($_POST['dir'] . $file) . "\">" . htmlentities($name) . "</a></li>";
}
}
Bu sağlanan bağlayıcı komut kod tüm bu güvenli değildir ve bu hassas klasörlere erişmek için kötüye kullanıcıları engellemek için adımlar atması gerektiğini unutmayın.