From e2b4760e846e8b74f2f674e1fa25d82ba21e7a2e Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 12 May 2014 13:08:25 -0400
Subject: [PATCH] Fix invalid closing tag

---
 program/lib/Roundcube/rcube_plugin.php |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/program/lib/Roundcube/rcube_plugin.php b/program/lib/Roundcube/rcube_plugin.php
index aa6d837..01c340d 100644
--- a/program/lib/Roundcube/rcube_plugin.php
+++ b/program/lib/Roundcube/rcube_plugin.php
@@ -3,7 +3,7 @@
 /*
  +-----------------------------------------------------------------------+
  | This file is part of the Roundcube Webmail client                     |
- | Copyright (C) 2008-2012, The Roundcube Dev Team                       |
+ | Copyright (C) 2008-2014, The Roundcube Dev Team                       |
  |                                                                       |
  | Licensed under the GNU General Public License version 3 or            |
  | any later version with exceptions for skins & plugins.                |
@@ -125,12 +125,16 @@
         $fpath = $this->home.'/'.$fname;
         $rcube = rcube::get_instance();
 
-        if (is_file($fpath) && !$rcube->config->load_from_file($fpath)) {
+        if (($is_local = is_file($fpath)) && !$rcube->config->load_from_file($fpath)) {
             rcube::raise_error(array(
                 'code' => 527, 'type' => 'php',
                 'file' => __FILE__, 'line' => __LINE__,
                 'message' => "Failed to load config from $fpath"), true, false);
             return false;
+        }
+        else if (!$is_local) {
+            // Search plugin_name.inc.php file in any configured path
+            return $rcube->config->load_from_file($this->ID . '.inc.php');
         }
 
         return true;
@@ -390,7 +394,11 @@
     public function local_skin_path()
     {
         $rcube = rcube::get_instance();
-        foreach (array($rcube->config->get('skin'), 'larry') as $skin) {
+        $skins = array_keys((array)$rcube->output->skins);
+        if (empty($skins)) {
+            $skins = array($rcube->config->get('skin'));
+        }
+        foreach ($skins as $skin) {
             $skin_path = 'skins/' . $skin;
             if (is_dir(realpath(slashify($this->home) . $skin_path))) {
                 break;

--
Gitblit v1.9.1