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

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2014-11-14 01:22:24 +0300
committerThomas Steur <tsteur@users.noreply.github.com>2014-11-14 01:22:24 +0300
commitca36bb8ba014d08bc400b0a70a9176153d814d4e (patch)
treed15626a669019792db6b11a560a6b988ea4e52e2 /core/FrontController.php
parent98a2ab4bd7b3cc37f5bbe18df28d50099a573c7e (diff)
parentffa5c1e86e578ff166d5c55a5edb1ca14f1e3d28 (diff)
Merge pull request #6587 from piwik/removeHtmlMessageException
Refactor out HtmlMessageException
Diffstat (limited to 'core/FrontController.php')
-rw-r--r--core/FrontController.php23
1 files changed, 14 insertions, 9 deletions
diff --git a/core/FrontController.php b/core/FrontController.php
index 16d5930fe2..25e56cc4f9 100644
--- a/core/FrontController.php
+++ b/core/FrontController.php
@@ -12,7 +12,7 @@ namespace Piwik;
use Exception;
use Piwik\API\Request;
use Piwik\API\ResponseBuilder;
-use Piwik\Exceptions\HtmlMessageException;
+use Piwik\Exception\AuthenticationFailedException;
use Piwik\Http\Router;
use Piwik\Plugin\Controller;
use Piwik\Plugin\Report;
@@ -420,10 +420,15 @@ class FrontController extends Singleton
try {
$authAdapter = Registry::get('auth');
} catch (Exception $e) {
- throw new HtmlMessageException("Authentication object cannot be found in the Registry. Maybe the Login plugin is not activated?
- <br />You can activate the plugin by adding:<br />
- <code>Plugins[] = Login</code><br />
- under the <code>[Plugins]</code> section in your config/config.ini.php");
+ $message = "Authentication object cannot be found in the Registry. Maybe the Login plugin is not activated?
+ <br />You can activate the plugin by adding:<br />
+ <code>Plugins[] = Login</code><br />
+ under the <code>[Plugins]</code> section in your config/config.ini.php";
+
+ $ex = new AuthenticationFailedException($message);
+ $ex->setIsHtmlMessage();
+
+ throw $ex;
}
Access::getInstance()->reloadAccess($authAdapter);
@@ -614,10 +619,10 @@ class FrontController extends Singleton
{
$debugTrace = $ex->getTraceAsString();
- if (method_exists($ex, 'getHtmlMessage')) {
- $message = $ex->getHtmlMessage();
- } else {
- $message = Common::sanitizeInputValue($ex->getMessage());
+ $message = $ex->getMessage();
+
+ if (!method_exists($ex, 'isHtmlMessage') || !$ex->isHtmlMessage()) {
+ $message = Common::sanitizeInputValue($message);
}
$logo = new CustomLogo();