[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:04: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         | jens at peino.de
  Summary            | Avoid notice in _removeBr from
                     | Text_Filter/Filter/highlightquotes.php
  Queue              | Horde Framework Packages
  Version            | HEAD
  Type               | Bug
  State              | Feedback
  Priority           | 1. Low
  Milestone          |
  Patch              | 1
  Owners             | Michael Slusarz
------------------------------------------------------------------------------


jens at peino.de (2009-03-13 15:04) wrote:

> 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 => $line) {
    if (!preg_match("/^\s*<br\s*\/>\s*$/i", $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 "unnice" for() loop.

I am fine either.

- Jens







More information about the bugs mailing list