From bd0551b22076b82a6d49e9f7a2b2e0c90a1b2326 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Fri, 05 Feb 2016 07:25:27 -0500
Subject: [PATCH] Secure also downloads of addressbook exports, managesieve script exports and Enigma keys exports

---
 program/lib/Roundcube/rcube_result_set.php |   33 ++++++++++++++++++++++++++++++---
 1 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/program/lib/Roundcube/rcube_result_set.php b/program/lib/Roundcube/rcube_result_set.php
index a4b070e..9d36a0f 100644
--- a/program/lib/Roundcube/rcube_result_set.php
+++ b/program/lib/Roundcube/rcube_result_set.php
@@ -1,6 +1,6 @@
 <?php
 
-/*
+/**
  +-----------------------------------------------------------------------+
  | This file is part of the Roundcube Webmail client                     |
  | Copyright (C) 2006-2013, The Roundcube Dev Team                       |
@@ -25,7 +25,7 @@
  * @package    Framework
  * @subpackage Addressbook
  */
-class rcube_result_set implements Iterator
+class rcube_result_set implements Iterator, ArrayAccess
 {
     public $count = 0;
     public $first = 0;
@@ -61,6 +61,34 @@
         $this->current = $i;
     }
 
+    /*** Implement PHP ArrayAccess interface ***/
+
+    public function offsetSet($offset, $value)
+    {
+        if (is_null($offset)) {
+            $offset = count($this->records);
+            $this->records[] = $value;
+        }
+        else {
+            $this->records[$offset] = $value;
+        }
+    }
+
+    public function offsetExists($offset)
+    {
+        return isset($this->records[$offset]);
+    }
+
+    public function offsetUnset($offset)
+    {
+        unset($this->records[$offset]);
+    }
+
+    public function offsetGet($offset)
+    {
+        return $this->records[$offset];
+    }
+
     /***  PHP 5 Iterator interface  ***/
 
     function rewind()
@@ -87,5 +115,4 @@
     {
         return isset($this->records[$this->current]);
     }
-
 }

--
Gitblit v1.9.1