Add some safety checks
This commit is contained in:
parent
9670d3e98b
commit
a469efb1f1
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
OCP\JSON::callCheck();
|
OCP\JSON::callCheck();
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
|
OCP\JSON::checkAppEnabled('files_sharing');
|
||||||
|
|
||||||
$l = OC_L10N::get('files_sharing');
|
$l = OC_L10N::get('files_sharing');
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,7 @@
|
||||||
* See the COPYING-README file.
|
* See the COPYING-README file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!\OC_App::isEnabled('files_sharing')) {
|
OCP\JSON::checkAppEnabled('files_sharing');
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($_GET['t'])) {
|
if (!isset($_GET['t'])) {
|
||||||
\OC_Response::setStatus(400); //400 Bad Request
|
\OC_Response::setStatus(400); //400 Bad Request
|
||||||
|
|
|
@ -6,12 +6,16 @@
|
||||||
* See the COPYING-README file.
|
* See the COPYING-README file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
OCP\JSON::checkAppEnabled('files_sharing');
|
||||||
|
OCP\JSON::checkLoggedIn();
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
$remote = $_GET['remote'];
|
$remote = $_GET['remote'];
|
||||||
|
|
||||||
if (file_get_contents('https://' . $remote . '/status.php')) {
|
if (file_get_contents('https://' . $remote . '/status.php')) {
|
||||||
echo 'https';
|
echo 'https';
|
||||||
} elseif (file_get_contents('http://' . $remote . '/status.php')) {
|
} elseif (file_get_contents('http://' . $remote . '/status.php')) {
|
||||||
echo 'http';
|
echo 'http';
|
||||||
}else{
|
} else {
|
||||||
echo 'false';
|
echo 'false';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue