From aba2b5d61d707aafe8d64ccdb406c4f20b9682d6 Mon Sep 17 00:00:00 2001 From: Horus3 Date: Mon, 17 Mar 2014 16:25:39 +0100 Subject: Fix: empty folder array. --- www/functions/func_select.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'www/functions/func_select.php') diff --git a/www/functions/func_select.php b/www/functions/func_select.php index 357b6b6..e23c3cf 100755 --- a/www/functions/func_select.php +++ b/www/functions/func_select.php @@ -6,21 +6,16 @@ function select_file_id($db, $owner){ } else { $share ="AND share='PUBLIC'"; // just use files with the correct permissions } - - if(empty($_GET["folder"])){ - $_GET["folder"] = "/"; - } - $folder_array_unsafe = explode("/",$_GET["folder"]); $length = count($folder_array_unsafe); $root_db = $db->query("SELECT id FROM files WHERE parent=0 AND owner=" . $owner . " AND folder='DIRECTORY' " . $share . ";"); $root_ar = $root_db->fetchArray(SQLITE3_NUM); + $root_id = $root_ar[0]; if(empty($root_ar)){ failure("Seems like the user doesn't want to show his tree: " . $root_id); } - $root_id = $root_ar[0]; $parentdir = SQLite3::escapeString($root_id); $temp_id = $root_id; -- cgit v1.2.3