From 50bf7a98c2d34e919144885db0b56ffed4e8e9c3 Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Sat, 22 Oct 2011 01:50:40 -0400 Subject: [PATCH] Redirect file browser if directory does not exist --- files/index.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/files/index.php b/files/index.php index bd37598289..8bb5b618d8 100644 --- a/files/index.php +++ b/files/index.php @@ -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 ){