<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>Gollem Auth thorws warning and pollutes Errorlog - fix available</title> 
  <pubDate>Fri, 10 Apr 2026 13:16:46 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/14580</link> 
  <atom:link rel="self" type="application/rss+xml" title="Gollem Auth thorws warning and pollutes Errorlog - fix available" href="https://bugs.horde.org/ticket/14580/rss" /> 
  <description>Gollem Auth thorws warning and pollutes Errorlog - fix available</description> 
 
   
   
  <item> 
   <title>Gollem Auth (gollem/lib/Auth.php ~line 340) throws warnings:</title> 
   <description>Gollem Auth (gollem/lib/Auth.php ~line 340) throws warnings: &quot;PHP ERROR: Invalid argument supplied for foreach()&quot;

Since the causing function _getBackends() is invoked several times, it pollutes the logfile.

In the mentioned function, the passwords are retrieved and iterated via foreach. However, if only a singlr password is returned, PHP complains that it is no array.

I propose to insert an cast into array to have a defined type presented to foreach() to correct the problem.


The fixed function should be like this:


gollem/lib/Auth.php:
    /**
     * Return stored backend list.
     *
     * @return array  Backend configuration list.
     */
    protected static function _getBackends()
    {
        global $session;

        if (($backends = $session-&gt;get(&#039;gollem&#039;, &#039;backends&#039;, $session::TYPE_ARRAY)) &amp;&amp;
            ($passwords = $session-&gt;get(&#039;gollem&#039;, &#039;backends_password&#039;, $session::TYPE_ARRAY))) {
            foreach ( (array) $passwords as $key =&gt; $val) {
                $backends[$key][&#039;params&#039;][&#039;password&#039;] = $val;
            }
        }

        return $backends;
    }


Thanks,
Torben</description> 
   <pubDate>Thu, 16 Feb 2017 16:01:27 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/14580#t91597</link> 
  </item> 
   
  <item> 
   <title>The real question is why is a non-array value returned from </title> 
   <description>The real question is why is a non-array value returned from $session-&gt;get when the TYPE_ARRAY mask is passed? Perhaps it&#039;s an issue in Horde_Session when a value is saved with the ENCRYPT mask but retrieved with the TYPE_ARRAY mask.</description> 
   <pubDate>Fri, 24 Feb 2017 17:55:32 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/14580#t91634</link> 
  </item> 
   
  <item> 
   <title>There seems to be some issue with decompressing certain arra</title> 
   <description>There seems to be some issue with decompressing certain arrays with numeric keys. I&#039;ve been able to reproduce it on one machine using PHP 5.6, but not on my dev machine running php 7. 

Still investigating.</description> 
   <pubDate>Thu, 02 Mar 2017 17:03:25 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/14580#t91671</link> 
  </item> 
   
  <item> 
   <title>&gt; There seems to be some issue with decompressing certain ar</title> 
   <description>&gt; There seems to be some issue with decompressing certain arrays with 
&gt; numeric keys. I&#039;ve been able to reproduce it on one machine using PHP 
&gt; 5.6, but not on my dev machine running php 7.
&gt;
&gt; Still investigating.

Thanks for the update</description> 
   <pubDate>Thu, 02 Mar 2017 17:31:20 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/14580#t91672</link> 
  </item> 
   
  <item> 
   <title>&gt; There seems to be some issue with decompressing certain ar</title> 
   <description>&gt; There seems to be some issue with decompressing certain arrays with 
&gt; numeric keys. I&#039;ve been able to reproduce it on one machine using PHP 
&gt; 5.6, but not on my dev machine running php 7.
&gt;
&gt; Still investigating.

....and now I can&#039;t reproduce it at all :(</description> 
   <pubDate>Thu, 02 Mar 2017 17:40:33 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/14580#t91673</link> 
  </item> 
   
  <item> 
   <title>Can you see what $passwords is equal to right before the for</title> 
   <description>Can you see what $passwords is equal to right before the for loop?

When it did break for me, it was an unencrypted binary string when the original $password array contained a single entry in element (int)0. If the entry was &quot;moved&quot; to element &#039;1&#039;, it worked but I can&#039;t get it to break again. It&#039;s always returned as an array now.</description> 
   <pubDate>Thu, 02 Mar 2017 17:48:43 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/14580#t91674</link> 
  </item> 
   
  <item> 
   <title>&gt; Can you see what $passwords is equal to right before the f</title> 
   <description>&gt; Can you see what $passwords is equal to right before the for loop?
&gt;
&gt; When it did break for me, it was an unencrypted binary string when 
&gt; the original $password array contained a single entry in element 
&gt; (int)0. If the entry was &quot;moved&quot; to element &#039;1&#039;, it worked but I 
&gt; can&#039;t get it to break again. It&#039;s always returned as an array now.

I&#039;ll check that, but I&#039;m on the road for four days. I&#039;ll come back to this issue on Tuesday or Wednesday.</description> 
   <pubDate>Thu, 02 Mar 2017 21:35:12 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/14580#t91675</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; Can you see what $passwords is equal to right before the </title> 
   <description>&gt;&gt; Can you see what $passwords is equal to right before the for loop?
&gt;&gt;
&gt;&gt; When it did break for me, it was an unencrypted binary string when
&gt;&gt; the original $password array contained a single entry in element
&gt;&gt; (int)0. If the entry was &quot;moved&quot; to element &#039;1&#039;, it worked but I
&gt;&gt; can&#039;t get it to break again. It&#039;s always returned as an array now.
&gt;
&gt; I&#039;ll check that, but I&#039;m on the road for four days. I&#039;ll come back to 
&gt; this issue on Tuesday or Wednesday.


Mike,

using the current set of stable pear packages of Horde, I&#039;m also not able to reproduce it. 

I recommend to close the bug. Thanks for your help.</description> 
   <pubDate>Mon, 03 Apr 2017 13:24:39 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/14580#t91754</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
