From 8bed5e0151eb375e2d2dc91e4e6c6d5aa62daa5c Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sun, 19 Jul 2015 05:06:48 -0400
Subject: [PATCH] Fix regression where compose editor mode was set incorrectly

---
 program/lib/Roundcube/rcube_plugin_api.php |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/program/lib/Roundcube/rcube_plugin_api.php b/program/lib/Roundcube/rcube_plugin_api.php
index 1a10b8d..179e7ef 100644
--- a/program/lib/Roundcube/rcube_plugin_api.php
+++ b/program/lib/Roundcube/rcube_plugin_api.php
@@ -1,6 +1,6 @@
 <?php
 
-/*
+/**
  +-----------------------------------------------------------------------+
  | This file is part of the Roundcube Webmail client                     |
  | Copyright (C) 2008-2012, The Roundcube Dev Team                       |
@@ -95,7 +95,7 @@
 
         foreach ($this->plugins as $plugin) {
             // ... task, request type and framed mode
-            if (!$this->filter($plugin)) {
+            if (!$this->plugins_initialized[$plugin_name] && !$this->filter($plugin)) {
                 $plugin->init();
                 $this->plugins_initialized[$plugin->ID] = $plugin;
             }
@@ -132,7 +132,7 @@
 
             // load required core plugin if no derivate was found
             if (!$loaded) {
-                $loaded = $this->load_plugin($plugin_name, true);
+                $loaded = $this->load_plugin($plugin_name);
             }
 
             // trigger fatal error if still not loaded
@@ -212,7 +212,7 @@
 
         if ($plugin = $this->plugins[$plugin_name]) {
             // init a plugin only if $force is set or if we're called after initialization
-            if (($force || $this->initialized) && !$this->plugins_initialized[$plugin_name] && !$this->filter($plugin)) {
+            if (($force || $this->initialized) && !$this->plugins_initialized[$plugin_name] && ($force || !$this->filter($plugin))) {
                 $plugin->init();
                 $this->plugins_initialized[$plugin_name] = $plugin;
             }

--
Gitblit v1.9.1