Redirect file browser if directory does not exist

This commit is contained in:
Michael Gapczynski 2011-10-22 01:50:40 -04:00
parent 4c256433c0
commit 50bf7a98c2
1 changed files with 4 additions and 0 deletions

View File

@ -42,6 +42,10 @@ if(!isset($_SESSION['timezone'])){
OC_App::setActiveNavigationEntry( "files_index" );
// Load the files
$dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
// Redirect if directory does not exist
if(!OC_Filesystem::is_dir($dir)) {
header("Location: ".$_SERVER['PHP_SELF']."");
}
$files = array();
foreach( OC_Files::getdirectorycontent( $dir ) as $i ){