Thomas Bruederli
2013-11-28 ce6050cbbbd207c2899acc8df4a59553e974eda9
program/lib/Roundcube/rcube_plugin_api.php
@@ -168,10 +168,11 @@
     * 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 @@
                // 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']))
                    ) {
@@ -283,6 +284,7 @@
        $composer = INSTALL_PATH . "/plugins/$plugin_name/composer.json";
        if (file_exists($composer) && ($json = @json_decode(file_get_contents($composer), true))) {
          list($info['vendor'], $info['name']) = explode('/', $json['name']);
          $info['version'] = $json['version'];
          $info['license'] = $json['license'];
          if ($license_uri = $license_uris[$info['license']])
            $info['license_uri'] = $license_uri;