From cd219a45dd64d7d6916656e5e1b3a4ead68974c2 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Fri, 18 Dec 2015 05:42:05 -0500
Subject: [PATCH] Fix regression where some message attachments could be missing on edit/forward (#1490608)

---
 program/lib/Roundcube/rcube_session.php |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/program/lib/Roundcube/rcube_session.php b/program/lib/Roundcube/rcube_session.php
index 23b1d33..d087182 100644
--- a/program/lib/Roundcube/rcube_session.php
+++ b/program/lib/Roundcube/rcube_session.php
@@ -293,6 +293,8 @@
     /**
      * Append the given value to the certain node in the session data array
      *
+     * Warning: Do not use if you already modified $_SESSION in the same request (#1490608)
+     *
      * @param string Path denoting the session variable where to append the value
      * @param string Key name under which to append the new value (use null for appending to an indexed list)
      * @param mixed  Value to append to the session data array
@@ -319,8 +321,9 @@
         $this->appends[] = $path;
 
         // when overwriting a previously unset variable
-        if ($this->unsets[$path])
+        if ($this->unsets[$path]) {
             unset($this->unsets[$path]);
+        }
     }
 
     /**
@@ -398,7 +401,6 @@
                 }
             }
         }
-
     }
 
     /**

--
Gitblit v1.9.1