summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2013-11-14 18:58:23 +0100
committerThomas Bruederli <thomas@roundcube.net>2013-11-14 18:58:23 +0100
commitcf319546617486ecd925efbc16c54885f83ec8ab (patch)
tree065da5bc2604c51d4bd4ae1fd5984e19b595305e
parente957bfecdf5c856320725fcbf7ec737127f614bd (diff)
Make require_plugin() force loading of the required plugin
-rw-r--r--program/lib/Roundcube/rcube_plugin.php2
-rw-r--r--program/lib/Roundcube/rcube_plugin_api.php5
2 files changed, 4 insertions, 3 deletions
diff --git a/program/lib/Roundcube/rcube_plugin.php b/program/lib/Roundcube/rcube_plugin.php
index 3153a8410..aa6d8376e 100644
--- a/program/lib/Roundcube/rcube_plugin.php
+++ b/program/lib/Roundcube/rcube_plugin.php
@@ -109,7 +109,7 @@ abstract class rcube_plugin
*/
public function require_plugin($plugin_name)
{
- return $this->api->load_plugin($plugin_name);
+ return $this->api->load_plugin($plugin_name, true);
}
/**
diff --git a/program/lib/Roundcube/rcube_plugin_api.php b/program/lib/Roundcube/rcube_plugin_api.php
index 2258f1486..e6d186a6b 100644
--- a/program/lib/Roundcube/rcube_plugin_api.php
+++ b/program/lib/Roundcube/rcube_plugin_api.php
@@ -168,10 +168,11 @@ class rcube_plugin_api
* Load the specified plugin
*
* @param string Plugin name
+ * @param boolean Force loading of the plugin even if it doesn't match the filter
*
* @return boolean True on success, false if not loaded or failure
*/
- public function load_plugin($plugin_name)
+ public function load_plugin($plugin_name, $force = false)
{
static $plugins_dir;
@@ -197,7 +198,7 @@ class rcube_plugin_api
// check inheritance...
if (is_subclass_of($plugin, 'rcube_plugin')) {
// ... task, request type and framed mode
- if ((!$plugin->task || preg_match('/^('.$plugin->task.')$/i', $this->task))
+ if ($force || (!$plugin->task || preg_match('/^('.$plugin->task.')$/i', $this->task))
&& (!$plugin->noajax || (is_object($this->output) && $this->output->type == 'html'))
&& (!$plugin->noframe || empty($_REQUEST['_framed']))
) {