diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2015-11-16 23:25:51 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2015-11-17 00:12:34 +0300 |
commit | ea30714acff275cff51930d6f4312722e4cb2916 (patch) | |
tree | f7e82e14e3185f6f10680fae2e97cd42334fcfc2 /core/Plugin/PluginException.php | |
parent | e90d8e45336809867bb84b1efd297e5dc748f96f (diff) |
show an error message if installing a plugin fails
Diffstat (limited to 'core/Plugin/PluginException.php')
-rw-r--r-- | core/Plugin/PluginException.php | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/core/Plugin/PluginException.php b/core/Plugin/PluginException.php index 90aa03a342..83816ca365 100644 --- a/core/Plugin/PluginException.php +++ b/core/Plugin/PluginException.php @@ -8,14 +8,28 @@ namespace Piwik\Plugin; +use Piwik\Common; + class PluginException extends \Exception { public function __construct($pluginName, $message) { - parent::__construct("There was a problem installing the plugin " . $pluginName . ": " . $message . " - If this plugin has already been installed, and if you want to hide this message</b>, you must add the following line under the - [PluginsInstalled] - entry in your config/config.ini.php file: - PluginsInstalled[] = $pluginName"); + $pluginName = Common::sanitizeInputValue($pluginName); + $message = Common::sanitizeInputValue($message); + + parent::__construct("There was a problem installing the plugin $pluginName: <br /><br /> + $message + <br /><br /> + If you want to hide this message you must remove the following line under the [Plugins] entry in your + 'config/config.ini.php' file to disable this plugin.<br /> + Plugins[] = $pluginName + <br /><br />If this plugin has already been installed, you must add the following line under the + [PluginsInstalled] entry in your 'config/config.ini.php' file:<br /> + PluginsInstalled[] = $pluginName"); + } + + public function isHtmlMessage() + { + return true; } } |