From 9e67902fce2eb112ca52fdf65fe310adb8d74093 Mon Sep 17 00:00:00 2001
From: Thomas Jarosch <thomas.jarosch@intra2net.com>
Date: Mon, 28 Jan 2013 11:47:21 +0100
Subject: [PATCH] Fix #11999: Prevent inserting empty share "objects" into
 $all_shares array.

Only insert shares that could be fetched.

Otherwise we crash later on f.e. in _sortShares()
since it expects a share object.

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
---
 framework/Share/lib/Horde/Share/Base.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/framework/Share/lib/Horde/Share/Base.php b/framework/Share/lib/Horde/Share/Base.php
index a304a62..523da96 100644
--- a/framework/Share/lib/Horde/Share/Base.php
+++ b/framework/Share/lib/Horde/Share/Base.php
@@ -272,7 +272,9 @@ abstract class Horde_Share_Base
         }
 
         foreach ($cids as $cid) {
-            $all_shares[$this->_shareMap[$cid]] = $this->_cache[$this->_shareMap[$cid]];
+            if (isset($this->_shareMap[$cid])) {
+                $all_shares[$this->_shareMap[$cid]] = $this->_cache[$this->_shareMap[$cid]];
+            }
         }
 
         return $all_shares;
-- 
1.7.11.7