Files: explicitly define

This commit is contained in:
Robin Appelman 2013-02-08 12:03:28 +01:00
parent 5ef9d96d10
commit 9bdc43e1fc
2 changed files with 4 additions and 0 deletions

View File

@ -11,6 +11,8 @@ $dir = stripslashes($_POST["dir"]);
$file = stripslashes($_POST["file"]);
$target = stripslashes(rawurldecode($_POST["target"]));
$l = OC_L10N::get('files');
if(\OC\Files\Filesystem::file_exists($target . '/' . $file)) {
OCP\JSON::error(array("data" => array( "message" => $l->t("Could not move %s - File with this name already exists", array($file)) )));
exit;

View File

@ -11,6 +11,8 @@ $dir = stripslashes($_GET["dir"]);
$file = stripslashes($_GET["file"]);
$newname = stripslashes($_GET["newname"]);
$l = OC_L10N::get('files');
if ( $newname !== '.' and ($dir != '' || $file != 'Shared') and $newname !== '.') {
$targetFile = \OC\Files\Filesystem::normalizePath($dir . '/' . $newname);
$sourceFile = \OC\Files\Filesystem::normalizePath($dir . '/' . $file);