summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-rw-r--r--www/functions/func_select.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/www/functions/func_select.php b/www/functions/func_select.php
index dc649f2..4ca9e66 100644
--- a/www/functions/func_select.php
+++ b/www/functions/func_select.php
@@ -1,6 +1,6 @@
<?
function select($db){
- if($_SESSION["login"]){
+ if($_SESSION["login"]){ // TODO: Check if loged in user really the user who does the query
$share="";
} else {
$share ="AND share='PUBLIC'";
@@ -28,7 +28,13 @@ function select($db){
failure("There is something seriously wrong. If you are a human you should never read this. Mail the admin please.");
}
$root_ar = $root_db->fetchArray(SQLITE3_NUM);
+ if(empty($root_ar)){
+ failure("empty");
+ }
$root_id = $root_ar[0];
+ if(!$root_id > 0){
+ failure("Seems like the user doesn't want to show his tree: " . $root_id);
+ }
$parentdir = SQLite3::escapeString($root_id);
$temp_id = $root_id;