diff options
author | alecpl <alec@alec.pl> | 2009-09-01 16:18:05 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2009-09-01 16:18:05 +0000 |
commit | 912bbbc20edc675f3906e146c718f60717d9d7e7 (patch) | |
tree | 6e23b27f792a88be402c0162359f524d874157e1 /program | |
parent | 57307bc782990b4f4cba70708f5a44cb3a2cd502 (diff) |
- fix loading required plugins (#1486079)
Diffstat (limited to 'program')
-rw-r--r-- | program/include/rcube_plugin_api.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/program/include/rcube_plugin_api.php b/program/include/rcube_plugin_api.php index b05758a3f..75f1cc478 100644 --- a/program/include/rcube_plugin_api.php +++ b/program/include/rcube_plugin_api.php @@ -118,15 +118,17 @@ class rcube_plugin_api if (!$loaded) { $fn = $plugins_dir->path . DIRECTORY_SEPARATOR . $plugin_name . DIRECTORY_SEPARATOR . $plugin_name . '.php'; if (file_exists($fn)) { - include($fn); + include_once($fn); if (class_exists($plugin_name, false)) { $plugin = new $plugin_name($this); // check inheritance if (is_subclass_of($plugin, 'rcube_plugin')) { - $plugin->init(); - $this->plugins[] = $plugin; - $loaded = true; + if (!$plugin->task || preg_match('/('.$plugin->task.')/i', $rcmail->task)) { + $plugin->init(); + $this->plugins[] = $plugin; + } + $loaded = true; } } } |