From b393c91a96aeb1346add8e0cb5a62747b07379f0 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Tue, 9 Apr 2013 13:44:54 +0200 Subject: wrong root dir name --- apps/files/ajax/rename.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apps/files/ajax/rename.php') 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") ))); -- cgit v1.2.3