diff options
author | Morris Jobke <morris.jobke@gmail.com> | 2013-04-09 13:31:12 +0200 |
---|---|---|
committer | Morris Jobke <morris.jobke@gmail.com> | 2013-05-12 11:47:22 +0200 |
commit | a878bd9923f68ce35146357fe089749f62ab0e27 (patch) | |
tree | 37636f544f1a9ae1f25a23630113ac0e45af29e1 | |
parent | 564f26475c13bb7c6a2432204b5f60015188e6e4 (diff) | |
download | nextcloud-server-a878bd9923f68ce35146357fe089749f62ab0e27.tar.gz nextcloud-server-a878bd9923f68ce35146357fe089749f62ab0e27.zip |
fix allowed rename of folder in root directory to reserved name "Shared"
refs #2159
-rw-r--r-- | apps/files/ajax/rename.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/files/ajax/rename.php b/apps/files/ajax/rename.php index 9fd2ce3ad4b..d9b59c6e487 100644 --- a/apps/files/ajax/rename.php +++ b/apps/files/ajax/rename.php @@ -13,7 +13,7 @@ $newname = stripslashes($_GET["newname"]); $l = OC_L10N::get('files'); -if ( $newname !== '.' and ($dir != '' || $file != 'Shared') and $newname !== '.') { +if ( $newname !== '.' and ($dir != '' || $file != 'Shared') and $newname !== 'Shared' ) { $targetFile = \OC\Files\Filesystem::normalizePath($dir . '/' . $newname); $sourceFile = \OC\Files\Filesystem::normalizePath($dir . '/' . $file); if(\OC\Files\Filesystem::rename($sourceFile, $targetFile)) { @@ -21,6 +21,8 @@ if ( $newname !== '.' and ($dir != '' || $file != 'Shared') and $newname !== '.' } else { OCP\JSON::error(array("data" => array( "message" => $l->t("Unable to rename file") ))); } -}else{ +} elseif( $newname === 'Shared' ) { + OCP\JSON::error(array("data" => array( "message" => $l->t("Invalid folder name. Usage of 'Shared' is reserved by Owncloud") ))); +} else { OCP\JSON::error(array("data" => array( "message" => $l->t("Unable to rename file") ))); } |