diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-04-20 16:27:16 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-05-02 09:31:22 +0200 |
commit | 9b875db8b8c264f8e98dc9fe0096d3bd4cb90e26 (patch) | |
tree | 1a8012d6a4a680d77af0eb477890b488dd6decc3 | |
parent | 271ba6da637c10a98d70829716ebf4ac1074dcc3 (diff) | |
download | nextcloud-server-9b875db8b8c264f8e98dc9fe0096d3bd4cb90e26.tar.gz nextcloud-server-9b875db8b8c264f8e98dc9fe0096d3bd4cb90e26.zip |
OCS API should catch LoginExceptions
Catching the login exception and returning false (login failed). Makes
the OCS API properly return data instead of printing the exception page.
-rw-r--r-- | lib/private/legacy/api.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/legacy/api.php b/lib/private/legacy/api.php index bab879c95f8..702b9df1927 100644 --- a/lib/private/legacy/api.php +++ b/lib/private/legacy/api.php @@ -356,7 +356,11 @@ class OC_API { if(isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW']) ) { $authUser = $_SERVER['PHP_AUTH_USER']; $authPw = $_SERVER['PHP_AUTH_PW']; - $return = OC_User::login($authUser, $authPw); + try { + $return = OC_User::login($authUser, $authPw); + } catch (\OC\User\LoginException $e) { + return false; + } if ($return === true) { self::$logoutRequired = true; |