diff options
-rw-r--r-- | core/Exceptions/HtmlMessageException.php | 12 | ||||
-rw-r--r-- | core/Exceptions/HtmlMessageExceptionInterface.php | 20 | ||||
-rw-r--r-- | core/FrontController.php | 5 |
3 files changed, 12 insertions, 25 deletions
diff --git a/core/Exceptions/HtmlMessageException.php b/core/Exceptions/HtmlMessageException.php index 69f809e1e0..243a0f1726 100644 --- a/core/Exceptions/HtmlMessageException.php +++ b/core/Exceptions/HtmlMessageException.php @@ -16,7 +16,15 @@ use Exception; * * @api */ -class HtmlMessageException extends Exception implements HtmlMessageExceptionInterface +class HtmlMessageException extends Exception { - // empty + /** + * Returns the exception message. + * + * @return string + */ + public function getHtmlMessage() + { + return $this->getMessage(); + } }
\ No newline at end of file diff --git a/core/Exceptions/HtmlMessageExceptionInterface.php b/core/Exceptions/HtmlMessageExceptionInterface.php deleted file mode 100644 index b96c2e0a84..0000000000 --- a/core/Exceptions/HtmlMessageExceptionInterface.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php -/** - * Piwik - free/libre analytics platform - * - * @link http://piwik.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - * - */ -namespace Piwik\Exceptions; - -/** - * Exceptions that implement this interface are assumed to have HTML content - * in their messages. - * - * @api - */ -interface HtmlMessageExceptionInterface -{ - // empty -}
\ No newline at end of file diff --git a/core/FrontController.php b/core/FrontController.php index 33dab49e47..0fa143d4b6 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -13,7 +13,6 @@ use Exception; use Piwik\API\Request; use Piwik\API\ResponseBuilder; use Piwik\Exceptions\HtmlMessageException; -use Piwik\Exceptions\HtmlMessageExceptionInterface; use Piwik\Http\Router; use Piwik\Plugin\Controller; use Piwik\Plugin\Report; @@ -614,8 +613,8 @@ class FrontController extends Singleton { $debugTrace = $ex->getTraceAsString(); - if ($ex instanceof HtmlMessageExceptionInterface) { - $message = $ex->getMessage(); + if (method_exists($ex, 'getHtmlMessage')) { + $message = $ex->getHtmlMessage(); } else { $message = Common::sanitizeInputValue($ex->getMessage()); } |