Check for existence of $_GET keys

Otherwise PHP errors are thrown in the error log.
This commit is contained in:
Lukas Reschke 2015-01-09 17:46:14 +01:00
parent b1031c6355
commit f65cf498f4
1 changed files with 5 additions and 5 deletions

View File

@ -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']]);
}