From 3412e50b54e3daac8745234e21ab6e72be0ed165 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Wed, 04 Jun 2014 11:20:33 -0400
Subject: [PATCH] Fix attachment menu structure and aria-attributes

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

diff --git a/program/lib/Roundcube/rcube_plugin.php b/program/lib/Roundcube/rcube_plugin.php
index a571609..f0af953 100644
--- a/program/lib/Roundcube/rcube_plugin.php
+++ b/program/lib/Roundcube/rcube_plugin.php
@@ -125,22 +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 {
-            $fname = $this->ID . '.inc.php';
+        }
+        else if (!$is_local) {
             // Search plugin_name.inc.php file in any configured path
-            if (!$rcube->config->load_from_file($fname)) {
-                rcube::raise_error(array(
-                    'code' => 527, 'type' => 'php',
-                    'file' => __FILE__, 'line' => __LINE__,
-                    'message' => "Failed to load $fname config file from any configured path"), true, false);
-                return false;
-            }
+            return $rcube->config->load_from_file($this->ID . '.inc.php');
         }
 
         return true;

--
Gitblit v1.9.1