summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHorus32014-03-17 16:25:39 +0100
committerHorus32014-03-17 16:25:39 +0100
commitaba2b5d61d707aafe8d64ccdb406c4f20b9682d6 (patch)
treea4f656567b41bb545278c8520f3d4141c19e94a8
parent60c9f3fc747676b630b4ee23eae243b44e9c6285 (diff)
downloadfiles.iamfabulous.de-aba2b5d61d707aafe8d64ccdb406c4f20b9682d6.tar.gz
Fix: empty folder array.
-rwxr-xr-xwww/functions/func_select.php7
1 files changed, 1 insertions, 6 deletions
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;