summaryrefslogtreecommitdiff
path: root/www/functions
diff options
context:
space:
mode:
authorHorus32014-03-18 01:08:43 +0100
committerHorus32014-03-18 01:08:43 +0100
commit7313f1b72659777e0c08d089293433109940d788 (patch)
tree162ddee778e3a31cb5d0bb440eaa8202c331093c /www/functions
parenta01b4b2380cdd06714128583fa4a891c3bb70353 (diff)
downloadfiles.iamfabulous.de-7313f1b72659777e0c08d089293433109940d788.tar.gz
Checks if new folder name contains a "/".
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)){