From f65cf498f474e8e3206237da8e90bd5819aefc84 Mon Sep 17 00:00:00 2001
From: Lukas Reschke <lukas@owncloud.com>
Date: Fri, 9 Jan 2015 17:46:14 +0100
Subject: [PATCH] Check for existence of $_GET keys

Otherwise PHP errors are thrown in the error log.
---
 apps/files/ajax/rename.php | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/apps/files/ajax/rename.php b/apps/files/ajax/rename.php
index 00c8a1e44db..6ea53468861 100644
--- a/apps/files/ajax/rename.php
+++ b/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']]);
 }
-- 
GitLab