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:
authormattab <matthieu.aubry@gmail.com>2013-10-07 05:08:56 +0400
committermattab <matthieu.aubry@gmail.com>2013-10-07 05:08:56 +0400
commit9d4e91ee598fa2b19cfc21acac18cb45d8702e39 (patch)
tree687c104e92628ab0ebfed526bb97b4a32c92f597 /plugins/CorePluginsAdmin/PluginInstaller.php
parentcb26fffe12b9b61a53240a8935f1b0ee6a94f1a8 (diff)
Refactoring + improve Trusted Host message
Diffstat (limited to 'plugins/CorePluginsAdmin/PluginInstaller.php')
-rw-r--r--plugins/CorePluginsAdmin/PluginInstaller.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/CorePluginsAdmin/PluginInstaller.php b/plugins/CorePluginsAdmin/PluginInstaller.php
index d284ff75c8..849b910e21 100644
--- a/plugins/CorePluginsAdmin/PluginInstaller.php
+++ b/plugins/CorePluginsAdmin/PluginInstaller.php
@@ -142,6 +142,11 @@ class PluginInstaller
throw new PluginInstallerException('Plugin is not valid, the plugin.json file does not specify the plugin name.');
}
+ if (!preg_match('/^[a-zA-Z0-9_-]+$/', $metadata->name)) {
+ throw new PluginInstallerException('The plugin name specified in plugin.json contains illegal characters. ' .
+ 'Plugin name can only contain following characters: [a-zA-Z0-9-_].');
+ }
+
if (empty($metadata->version)) {
throw new PluginInstallerException('Plugin is not valid, the plugin.json file does not specify the plugin version.');
}