summaryrefslogtreecommitdiffstats
path: root/apps/files/ajax/rename.php
diff options
context:
space:
mode:
authorMorris Jobke <morris.jobke@gmail.com>2013-04-09 13:44:54 +0200
committerMorris Jobke <morris.jobke@gmail.com>2013-05-12 11:47:22 +0200
commitb393c91a96aeb1346add8e0cb5a62747b07379f0 (patch)
treef75b482763a16b30b59b1b02dacffbcecf04be26 /apps/files/ajax/rename.php
parenta878bd9923f68ce35146357fe089749f62ab0e27 (diff)
downloadnextcloud-server-b393c91a96aeb1346add8e0cb5a62747b07379f0.tar.gz
nextcloud-server-b393c91a96aeb1346add8e0cb5a62747b07379f0.zip
wrong root dir name
Diffstat (limited to 'apps/files/ajax/rename.php')
-rw-r--r--apps/files/ajax/rename.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/files/ajax/rename.php b/apps/files/ajax/rename.php
index d9b59c6e487..50bbe54bd25 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 !== 'Shared' ) {
+if ( $newname !== '.' and ($dir != '/' || $file != 'Shared') and ($dir !== '/' || $newname !== 'Shared') ) {
$targetFile = \OC\Files\Filesystem::normalizePath($dir . '/' . $newname);
$sourceFile = \OC\Files\Filesystem::normalizePath($dir . '/' . $file);
if(\OC\Files\Filesystem::rename($sourceFile, $targetFile)) {
@@ -21,7 +21,7 @@ if ( $newname !== '.' and ($dir != '' || $file != 'Shared') and $newname !== 'Sh
} else {
OCP\JSON::error(array("data" => array( "message" => $l->t("Unable to rename file") )));
}
-} elseif( $newname === 'Shared' ) {
+} elseif( $dir === '/' and $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") )));