Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/user_saml.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-05-02 15:35:36 +0300
committerJulius Härtl <jus@bitgrid.net>2019-05-02 15:35:36 +0300
commit485602586374130ed9d227cf6917536dc9a476e8 (patch)
treee962665d7f56f8bc07d3bfbccc0e3b6c7f408189
parent9f0af73761cc9ac97b7f17ecfed502d827b3ba3e (diff)
Catch exception during parameter fetching
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r--appinfo/app.php20
1 files changed, 17 insertions, 3 deletions
diff --git a/appinfo/app.php b/appinfo/app.php
index 57baa188..e329d9f7 100644
--- a/appinfo/app.php
+++ b/appinfo/app.php
@@ -54,6 +54,8 @@ $userBackend = new \OCA\User_SAML\UserBackend(
$userBackend->registerBackends(\OC::$server->getUserManager()->getBackends());
OC_User::useBackend($userBackend);
+$params = [];
+
// Setting up the one login config may fail, if so, do not catch the requests later.
$returnScript = false;
$type = '';
@@ -107,7 +109,11 @@ if(!$cli &&
!$userSession->isLoggedIn() &&
\OC::$server->getRequest()->getPathInfo() === '/login' &&
$type !== '') {
- $params = $request->getParams();
+ try {
+ $params = $request->getParams();
+ } catch (\LogicException $e) {
+ // ignore exception when PUT is called since getParams cannot parse parameters in that case
+ }
if (isset($params['direct'])) {
return;
}
@@ -136,7 +142,11 @@ $configuredIdps = $samlSettings->getListOfIdps();
$showLoginOptions = $multipleUserBackEnds || count($configuredIdps) > 1;
if ($redirectSituation === true && $showLoginOptions) {
- $params = $request->getParams();
+ try {
+ $params = $request->getParams();
+ } catch (\LogicException $e) {
+ // ignore exception when PUT is called since getParams cannot parse parameters in that case
+ }
$redirectUrl = '';
if(isset($params['redirect_url'])) {
$redirectUrl = $params['redirect_url'];
@@ -154,7 +164,11 @@ if ($redirectSituation === true && $showLoginOptions) {
}
if($redirectSituation === true) {
- $params = $request->getParams();
+ try {
+ $params = $request->getParams();
+ } catch (\LogicException $e) {
+ // ignore exception when PUT is called since getParams cannot parse parameters in that case
+ }
$originalUrl = '';
if(isset($params['redirect_url'])) {
$originalUrl = $urlGenerator->getAbsoluteURL($params['redirect_url']);