summaryrefslogtreecommitdiff
path: root/www/functions
diff options
context:
space:
mode:
Diffstat (limited to 'www/functions')
-rw-r--r--www/functions/func_folder.php6
1 files changed, 5 insertions, 1 deletions
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."<br>"; 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)){