From e48f8945b32ab5b67f1cdeb53a37d3d196e31e4d Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Fri, 20 May 2016 05:19:01 -0400
Subject: [PATCH] Fix bug where message list columns could be in wrong order after column drag-n-drop and list sorting

---
 program/include/rcmail_output_json.php |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/program/include/rcmail_output_json.php b/program/include/rcmail_output_json.php
index 22edce9..91262ac 100644
--- a/program/include/rcmail_output_json.php
+++ b/program/include/rcmail_output_json.php
@@ -2,7 +2,7 @@
 
 /*
  +-----------------------------------------------------------------------+
- | program/include/rc,ai�_output_json.php                                |
+ | program/include/rcmail_output_json.php                                |
  |                                                                       |
  | This file is part of the Roundcube Webmail client                     |
  | Copyright (C) 2008-2012, The Roundcube Dev Team                       |
@@ -23,7 +23,7 @@
 /**
  * View class to produce JSON responses
  *
- * @package    Core
+ * @package Webmail
  * @subpackage View
  */
 class rcmail_output_json extends rcmail_output
@@ -181,6 +181,11 @@
      */
     public function raise_error($code, $message)
     {
+        if ($code == 403) {
+            header('HTTP/1.1 403 Forbidden');
+            die("Invalid Request");
+        }
+
         $this->show_message("Application Error ($code): $message", 'error');
         $this->remote_response();
         exit;
@@ -227,6 +232,13 @@
         if (!empty($this->callbacks))
             $response['callbacks'] = $this->callbacks;
 
+        // trigger generic hook where plugins can put additional content to the response
+        $hook = $this->app->plugins->exec_hook("render_response", array('response' => $response));
+
+        // save some memory
+        $response = $hook['response'];
+        unset($hook['response']);
+
         echo self::json_serialize($response);
     }
 

--
Gitblit v1.9.1