diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-10-07 05:08:56 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-10-07 05:08:56 +0400 |
commit | 9d4e91ee598fa2b19cfc21acac18cb45d8702e39 (patch) | |
tree | 687c104e92628ab0ebfed526bb97b4a32c92f597 /plugins/CorePluginsAdmin/PluginInstaller.php | |
parent | cb26fffe12b9b61a53240a8935f1b0ee6a94f1a8 (diff) |
Refactoring + improve Trusted Host message
Diffstat (limited to 'plugins/CorePluginsAdmin/PluginInstaller.php')
-rw-r--r-- | plugins/CorePluginsAdmin/PluginInstaller.php | 5 |
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.'); } |