diff --git a/apps/files_sharing/ajax/external.php b/apps/files_sharing/ajax/external.php
index da73310c8df90514d42125bb91893bb86ca11a49..52c84b7babbc3c1c0e84237e04ceead2e187dd42 100644
--- a/apps/files_sharing/ajax/external.php
+++ b/apps/files_sharing/ajax/external.php
@@ -8,6 +8,7 @@
 
 OCP\JSON::callCheck();
 OCP\JSON::checkLoggedIn();
+OCP\JSON::checkAppEnabled('files_sharing');
 
 $l = OC_L10N::get('files_sharing');
 
diff --git a/apps/files_sharing/ajax/shareinfo.php b/apps/files_sharing/ajax/shareinfo.php
index be26c3579785f320d2a7c906f7a4318138f8cc1f..e87b0779e8d653d47800eaba070d14c8e4ea9246 100644
--- a/apps/files_sharing/ajax/shareinfo.php
+++ b/apps/files_sharing/ajax/shareinfo.php
@@ -6,9 +6,7 @@
  * See the COPYING-README file.
  */
 
-if (!\OC_App::isEnabled('files_sharing')) {
-	exit;
-}
+OCP\JSON::checkAppEnabled('files_sharing');
 
 if (!isset($_GET['t'])) {
 	\OC_Response::setStatus(400); //400 Bad Request
diff --git a/apps/files_sharing/ajax/testremote.php b/apps/files_sharing/ajax/testremote.php
index 10ea3075ed3d993c6e84a8a3666a493d067df2f9..5a0730088323f4a4bc9a1b70f628d7a0c96ec19e 100644
--- a/apps/files_sharing/ajax/testremote.php
+++ b/apps/files_sharing/ajax/testremote.php
@@ -6,12 +6,16 @@
  * See the COPYING-README file.
  */
 
+OCP\JSON::checkAppEnabled('files_sharing');
+OCP\JSON::checkLoggedIn();
+OCP\JSON::callCheck();
+
 $remote = $_GET['remote'];
 
 if (file_get_contents('https://' . $remote . '/status.php')) {
 	echo 'https';
 } elseif (file_get_contents('http://' . $remote . '/status.php')) {
 	echo 'http';
-}else{
+} else {
 	echo 'false';
 }