From 08e3c8941ea8cb136742ddc75e347a6f0fc2719e Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 3 Mar 2014 01:56:56 +0100 Subject: [PATCH] Resolved two issues related to exceptions --- .../exception/InvalidSecurityTokenException.class.php | 2 +- .../lib/system/exception/UserException.class.php | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/exception/InvalidSecurityTokenException.class.php b/wcfsetup/install/files/lib/system/exception/InvalidSecurityTokenException.class.php index bce56e1cc3..f17cf25746 100644 --- a/wcfsetup/install/files/lib/system/exception/InvalidSecurityTokenException.class.php +++ b/wcfsetup/install/files/lib/system/exception/InvalidSecurityTokenException.class.php @@ -12,7 +12,7 @@ use wcf\system\WCF; * @subpackage system.exception * @category Community Framework */ -class InvalidSecurityTokenException extends UserException { +class InvalidSecurityTokenException extends NamedUserException { /** * Creates a new InvalidSecurityTokenException object. */ diff --git a/wcfsetup/install/files/lib/system/exception/UserException.class.php b/wcfsetup/install/files/lib/system/exception/UserException.class.php index 1bc0a129eb..e6c27b039f 100644 --- a/wcfsetup/install/files/lib/system/exception/UserException.class.php +++ b/wcfsetup/install/files/lib/system/exception/UserException.class.php @@ -6,7 +6,7 @@ use wcf\system\WCF; * A UserException is thrown when a user gives invalid input data. * * @author Marcel Werk - * @copyright 2001-2013 WoltLab GmbH + * @copyright 2001-2014 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage system.exception @@ -24,4 +24,13 @@ abstract class UserException extends \Exception implements IPrintableException { echo '
' . $this->_getMessage() . '
'; } } + + /** + * Returns the exception's message, should be used to sanitize the output. + * + * @return string + */ + protected function _getMessage() { + return $this->getMessage(); + } } -- 2.20.1