<?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>Avoid notice in _removeBr from Text_Filter/Filter/highlightquotes.php</title> 
  <pubDate>Fri, 10 Apr 2026 01:05:01 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/8079</link> 
  <atom:link rel="self" type="application/rss+xml" title="Avoid notice in _removeBr from Text_Filter/Filter/highlightquotes.php" href="https://bugs.horde.org/ticket/8079/rss" /> 
  <description>Avoid notice in _removeBr from Text_Filter/Filter/highlightquotes.php</description> 
 
   
   
  <item> 
   <title>In some circumstances $lines does only contain &lt;br /&gt; and th</title> 
   <description>In some circumstances $lines does only contain &lt;br /&gt; and thus a notice is thrown from the second loop.</description> 
   <pubDate>Fri, 13 Mar 2009 15:13:43 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/8079#t53068</link> 
  </item> 
   
  <item> 
   <title>HMPF, typo in my patch. Added fixed one.</title> 
   <description>HMPF, typo in my patch. Added fixed one.</description> 
   <pubDate>Fri, 13 Mar 2009 15:15:10 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/8079#t53069</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in CVS for this ticket:

http://cvs.h</title> 
   <description>Changes have been made in CVS for this ticket:

http://cvs.horde.org/diff.php/framework/Text_Filter/Filter/highlightquotes.php?rt=horde&amp;r1=1.41&amp;r2=1.42&amp;ty=u</description> 
   <pubDate>Fri, 13 Mar 2009 18:46:41 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/8079#t53079</link> 
  </item> 
   
  <item> 
   <title>How about my patch, which removes for() loops entirely?</title> 
   <description>How about my patch, which removes for() loops entirely?</description> 
   <pubDate>Fri, 13 Mar 2009 18:47:19 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/8079#t53080</link> 
  </item> 
   
  <item> 
   <title>&gt; How about my patch, which removes for() loops entirely?


</title> 
   <description>&gt; How about my patch, which removes for() loops entirely?



Looks also fine to me.



Instead of:

foreach (array_keys($lines) as $i) {

You could use:

foreach ($lines as $i =&gt; $line) {

   if (!preg_match(&quot;/^\s*&lt;br\s*\/&gt;\s*$/i&quot;, $line)) {

       ...



To eliminate the extra array_keys() call.

But at the end its the same.

Your new approach is _technically seen_ maybe a little more expensive, but it does indeed remove the &quot;unnice&quot; for() loop.



I am fine either.



- Jens

</description> 
   <pubDate>Fri, 13 Mar 2009 19:04:34 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/8079#t53082</link> 
  </item> 
   
  <item> 
   <title>&gt; Instead of:

&gt; foreach (array_keys($lines) as $i) {

&gt; You</title> 
   <description>&gt; Instead of:

&gt; foreach (array_keys($lines) as $i) {

&gt; You could use:

&gt; foreach ($lines as $i =&gt; $line) {

&gt;    if (!preg_match(&quot;/^\s*&lt;br\s*\/&gt;\s*$/i&quot;, $line)) {

&gt;        ...

&gt;

&gt; To eliminate the extra array_keys() call.



No, you can&#039;t do that.  Since foreach() works on a copy of the original array, the unset() calls would not destroy the data contained in the initial array.  Thus the need to iterate through the array keys and use them to access the original variable.</description> 
   <pubDate>Fri, 13 Mar 2009 19:11:34 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/8079#t53084</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
