[Svn] r2907 - trunk/roundcubemail/program/include

trac at roundcube.net trac at roundcube.net
Tue Sep 1 18:18:05 CEST 2009


Author: alec
Date: 2009-09-01 11:18:05 -0500 (Tue, 01 Sep 2009)
New Revision: 2907

Modified:
   trunk/roundcubemail/program/include/rcube_plugin_api.php
Log:
- fix loading required plugins (#1486079)


Modified: trunk/roundcubemail/program/include/rcube_plugin_api.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_plugin_api.php	2009-09-01 15:49:23 UTC (rev 2906)
+++ trunk/roundcubemail/program/include/rcube_plugin_api.php	2009-09-01 16:18:05 UTC (rev 2907)
@@ -118,15 +118,17 @@
       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;
             }
           }
         }

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list