diff options
author | Michael Hamann <michael@content-space.de> | 2012-09-18 01:24:46 +0200 |
---|---|---|
committer | Michael Hamann <michael@content-space.de> | 2012-09-18 01:28:19 +0200 |
commit | ce7fb7d76f8bc2d0c23b5fa8208fe9fbd668db9a (patch) | |
tree | 1e1a7388e8e62644858621fb2a60d0434e0d20a9 /inc/plugincontroller.class.php | |
parent | 19e77bae285ac9b74c39b7bfe457bb2d8331984a (diff) | |
download | rpg-ce7fb7d76f8bc2d0c23b5fa8208fe9fbd668db9a.tar.gz rpg-ce7fb7d76f8bc2d0c23b5fa8208fe9fbd668db9a.tar.bz2 |
Only complain about invalid plugin names when plugins are loaded FS#2595
This fixes error messages about invalid plugin names for directories in
the plugin directory which didn't contain any plugin. Now the message is
only displayed for plugins which couldn't be loaded because of the
invalid name.
Diffstat (limited to 'inc/plugincontroller.class.php')
-rw-r--r-- | inc/plugincontroller.class.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/inc/plugincontroller.class.php b/inc/plugincontroller.class.php index 968d47a5c..0b4041a77 100644 --- a/inc/plugincontroller.class.php +++ b/inc/plugincontroller.class.php @@ -97,6 +97,9 @@ class Doku_Plugin_Controller { $inf = confToHash(DOKU_PLUGIN."$dir/plugin.info.txt"); if($inf['base'] && $inf['base'] != $plugin){ msg(sprintf("Plugin installed incorrectly. Rename plugin directory '%s' to '%s'.", hsc($plugin), hsc($inf['base'])), -1); + } elseif (preg_match('/^'.DOKU_PLUGIN_NAME_REGEX.'$/', $plugin) !== 1) { + msg(sprintf("Plugin name '%s' is not a valid plugin name, only the characters a-z and 0-9 are allowed. ". + 'Maybe the plugin has been installed in the wrong directory?', hsc($plugin)), -1); } return null; } @@ -156,10 +159,6 @@ class Doku_Plugin_Controller { } else { $all_plugins[$plugin] = 1; } - if ($all_plugins[$plugin] == 1 && preg_match('/^'.DOKU_PLUGIN_NAME_REGEX.'$/', $plugin) !== 1) { - msg(sprintf("Plugin name '%s' is not a valid plugin name, only the characters a-z and 0-9 are allowed. ". - 'Maybe the plugin has been installed in the wrong directory?', hsc($plugin)), -1); - } } $this->tmp_plugins = $all_plugins; if (!file_exists($this->last_local_config_file)) { |