diff --git a/lib/public/InvalidUserTokenException.php b/lib/public/InvalidUserTokenException.php index 502d73a07450..0fba38b61bfb 100644 --- a/lib/public/InvalidUserTokenException.php +++ b/lib/public/InvalidUserTokenException.php @@ -28,6 +28,7 @@ * @since 10.0.10 */ class InvalidUserTokenException extends UserTokenException { + /** * InvalidUserTokenException constructor. * @@ -35,7 +36,7 @@ class InvalidUserTokenException extends UserTokenException { * @param int $code * @since 10.0.10 */ - public function __construct($message = "", $code = 0) { - parent::__construct($message, $code, $this); + public function __construct($message = "", $code = 0, \Exception $previous = null) { + parent::__construct($message, $code, $previous); } } diff --git a/lib/public/UserTokenExpiredException.php b/lib/public/UserTokenExpiredException.php index 57dd27fba5c0..159d73e1295a 100644 --- a/lib/public/UserTokenExpiredException.php +++ b/lib/public/UserTokenExpiredException.php @@ -28,6 +28,9 @@ * @since 10.0.10 */ class UserTokenExpiredException extends UserTokenException { + /** @var UserTokenExpiredException */ + private $previousException; + /** * UserTokenExpiredException constructor. * @@ -35,7 +38,7 @@ class UserTokenExpiredException extends UserTokenException { * @param int $code * @since 10.0.10 */ - public function __construct($message = "", $code = 0) { - parent::__construct($message, $code, $this); + public function __construct($message = "", $code = 0, \Exception $previous = null) { + parent::__construct($message, $code, $previous); } } diff --git a/lib/public/UserTokenMismatchException.php b/lib/public/UserTokenMismatchException.php index f5578ec53322..e8abd908628d 100644 --- a/lib/public/UserTokenMismatchException.php +++ b/lib/public/UserTokenMismatchException.php @@ -35,7 +35,7 @@ class UserTokenMismatchException extends UserTokenException { * @param int $code * @since 10.0.10 */ - public function __construct($message = "", $code = 0) { - parent::__construct($message, $code, $this); + public function __construct($message = "", $code = 0, \Exception $previous = null) { + parent::__construct($message, $code, $previous); } } diff --git a/settings/Controller/UsersController.php b/settings/Controller/UsersController.php index 4cc6c70554dd..65c7f0c7d010 100644 --- a/settings/Controller/UsersController.php +++ b/settings/Controller/UsersController.php @@ -522,7 +522,7 @@ public function setPasswordForm($token, $userId) { try { $this->checkPasswordSetToken($token, $userId); } catch (UserTokenException $e) { - if ($e->getPrevious() instanceof UserTokenExpiredException) { + if ($e instanceof UserTokenExpiredException) { return new TemplateResponse( 'settings', 'resendtokenbymail', [