[Pkg-owncloud-commits] [owncloud] 148/223: Add some safety checks

David Prévot taffit at moszumanska.debian.org
Sun Jun 22 01:54:18 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit a469efb1f1a727255731b8fe8e1d0354e245695f
Author: Robin Appelman <icewind at owncloud.com>
Date:   Mon Jun 16 12:42:28 2014 +0200

    Add some safety checks
---
 apps/files_sharing/ajax/external.php   | 1 +
 apps/files_sharing/ajax/shareinfo.php  | 4 +---
 apps/files_sharing/ajax/testremote.php | 6 +++++-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/apps/files_sharing/ajax/external.php b/apps/files_sharing/ajax/external.php
index da73310..52c84b7 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 be26c35..e87b077 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 10ea307..5a07300 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';
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list