[Tickets #8079] Re: Avoid notice in _removeBr from Text_Filter/Filter/highlightquotes.php

bugs at horde.org bugs at horde.org
Fri Mar 13 19:11:34 UTC 2009


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/8079
------------------------------------------------------------------------------
  Ticket             | 8079
  Updated By         | Michael Slusarz <slusarz at horde.org>
  Summary            | Avoid notice in _removeBr from
                     | Text_Filter/Filter/highlightquotes.php
  Queue              | Horde Framework Packages
  Version            | HEAD
  Type               | Bug
-State              | Feedback
+State              | Resolved
  Priority           | 1. Low
  Milestone          |
  Patch              | 1
  Owners             | Michael Slusarz
------------------------------------------------------------------------------


Michael Slusarz <slusarz at horde.org> (2009-03-13 15:11) wrote:

> Instead of:
> foreach (array_keys($lines) as $i) {
> You could use:
> foreach ($lines as $i => $line) {
>    if (!preg_match("/^\s*<br\s*\/>\s*$/i", $line)) {
>        ...
>
> To eliminate the extra array_keys() call.

No, you can'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.






More information about the bugs mailing list