Summary | Avoid notice in _removeBr from Text_Filter/Filter/highlightquotes.php |
Queue | Horde Framework Packages |
Queue Version | HEAD |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | slusarz (at) horde (dot) org |
Requester | jens (at) peino (dot) de |
Created | 03/13/2009 (5959 days ago) |
Due | |
Updated | 03/13/2009 (5959 days ago) |
Assigned | 03/13/2009 (5959 days ago) |
Resolved | 03/13/2009 (5959 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | Yes |
State ⇒ Resolved
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.
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.
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
State ⇒ Feedback
http://cvs.horde.org/diff.php/framework/Text_Filter/Filter/highlightquotes.php?rt=horde&r1=1.41&r2=1.42&ty=u
State ⇒ Assigned
New Attachment: Text_Filter_Filter_highlightquotes[1].patch
State ⇒ Unconfirmed
New Attachment: Text_Filter_Filter_highlightquotes.patch
Patch ⇒ Yes
Milestone ⇒
Queue ⇒ Horde Framework Packages
Summary ⇒ Avoid notice in _removeBr from Text_Filter/Filter/highlightquotes.php
Type ⇒ Bug
Priority ⇒ 1. Low
notice is thrown from the second loop.