summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-07-26 08:11:43 +0000
committeralecpl <alec@alec.pl>2010-07-26 08:11:43 +0000
commitd5d968048601fa1d519f7cfee11f23918afc186c (patch)
treee792c437f66e97830e78b4d2f5f73b8e04a79197
parenta954a0490e9b02fa3c4de9ab894476b04df87d30 (diff)
- Fix double slash in plugin directory path (#1486872)
-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);