diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2014-11-14 01:58:06 +0300 |
---|---|---|
committer | Matthieu Napoli <matthieu@mnapoli.fr> | 2014-11-14 01:58:06 +0300 |
commit | 7f7cc482e54158bf3478cebb5359a2ec0bc58ec9 (patch) | |
tree | 848d169b0611a0c7d5b7d4a1e8c42108618da970 /core/FrontController.php | |
parent | c831518f45f2e75dce59639e7a2a10a90a830c91 (diff) | |
parent | ca36bb8ba014d08bc400b0a70a9176153d814d4e (diff) |
Merge branch 'master' into di-config
Conflicts:
core/FrontController.php
Diffstat (limited to 'core/FrontController.php')
-rw-r--r-- | core/FrontController.php | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/core/FrontController.php b/core/FrontController.php index f49fa94655..553f6b393f 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -13,7 +13,7 @@ use Exception; use Piwik\API\Request; use Piwik\API\ResponseBuilder; use Piwik\Container\StaticContainer; -use Piwik\Exceptions\HtmlMessageException; +use Piwik\Exception\AuthenticationFailedException; use Piwik\Http\Router; use Piwik\Plugin\Controller; use Piwik\Plugin\Report; @@ -421,10 +421,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); @@ -615,10 +620,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(); |