summaryrefslogtreecommitdiff
path: root/program/include/rcube_plugin_api.php
diff options
context:
space:
mode:
Diffstat (limited to 'program/include/rcube_plugin_api.php')
-rw-r--r--program/include/rcube_plugin_api.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/program/include/rcube_plugin_api.php b/program/include/rcube_plugin_api.php
index 9053a0d93..123c56a45 100644
--- a/program/include/rcube_plugin_api.php
+++ b/program/include/rcube_plugin_api.php
@@ -77,16 +77,17 @@ class rcube_plugin_api
{
$rcmail = rcmail::get_instance();
$this->output = $rcmail->output;
-
+
$plugins_dir = dir($this->dir);
+ $plugins_dir = unslashify($plugins_dir->path);
$plugins_enabled = (array)$rcmail->config->get('plugins', array());
-
+
foreach ($plugins_enabled as $plugin_name) {
- $fn = $plugins_dir->path . DIRECTORY_SEPARATOR . $plugin_name . DIRECTORY_SEPARATOR . $plugin_name . '.php';
-
+ $fn = $plugins_dir . DIRECTORY_SEPARATOR . $plugin_name . DIRECTORY_SEPARATOR . $plugin_name . '.php';
+
if (file_exists($fn)) {
include($fn);
-
+
// instantiate class if exists
if (class_exists($plugin_name, false)) {
$plugin = new $plugin_name($this);
@@ -121,7 +122,8 @@ class rcube_plugin_api
// load required core plugin if no derivate was found
if (!$loaded) {
- $fn = $plugins_dir->path . DIRECTORY_SEPARATOR . $plugin_name . DIRECTORY_SEPARATOR . $plugin_name . '.php';
+ $fn = $plugins_dir . DIRECTORY_SEPARATOR . $plugin_name . DIRECTORY_SEPARATOR . $plugin_name . '.php';
+
if (file_exists($fn)) {
include_once($fn);