Check for existence of $_GET keys

Otherwise PHP errors are thrown in the error log.
remotes/origin/fix-10825
Lukas Reschke 10 years ago
parent b1031c6355
commit f65cf498f4
  1. 10
      apps/files/ajax/rename.php

@ -30,13 +30,13 @@ $files = new \OCA\Files\App(
\OC::$server->getL10N('files')
);
$result = $files->rename(
$_GET["dir"],
$_GET["file"],
$_GET["newname"]
isset($_GET['dir']) ? $_GET['dir'] : '',
isset($_GET['file']) ? $_GET['file'] : '',
isset($_GET['newname']) ? $_GET['newname'] : ''
);
if($result['success'] === true){
OCP\JSON::success(array('data' => $result['data']));
OCP\JSON::success(['data' => $result['data']]);
} else {
OCP\JSON::error(array('data' => $result['data']));
OCP\JSON::error(['data' => $result['data']]);
}

Loading…
Cancel
Save