From 7313f1b72659777e0c08d089293433109940d788 Mon Sep 17 00:00:00 2001 From: Horus3 Date: Tue, 18 Mar 2014 01:08:43 +0100 Subject: Checks if new folder name contains a "/". --- www/functions/func_folder.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'www/functions/func_folder.php') diff --git a/www/functions/func_folder.php b/www/functions/func_folder.php index 537e106..cd60852 100644 --- a/www/functions/func_folder.php +++ b/www/functions/func_folder.php @@ -17,7 +17,11 @@ function create_folder($path, $new_folder_name, $share){ return MKDIR_OWNER; } -// echo "path: ".$path." file_id: ".$file_id." userid: ".$_SESSION['userid']." new_folder_name: ".$new_folder_name." share: ".$share."
"; exit; + //TODO: Cut trailing or leading slash + //TODO: Maye create two folders instead of returning an error? + if(preg_match("/\//", $new_folder_name)){ + return MKDIR_SLASH_IN_FOLDER_NAME; + } $dupl_db = $db->query("SELECT parent FROM files WHERE name='" . SQLite3::escapeString($new_folder_name) . "';"); while($dupl_ar = $dupl_db->fetchArray(SQLITE3_NUM)){ -- cgit v1.2.3