ZF-2870: HtmlList doesn't pass on the escape parameter for sub lists
Description
The HtmlList helper accepts an 'escape' parameter to determine whether or not to escape given list before rendering. But when it recursively calls itself to render sub lists, it doesn't pass on the escape parameter so sub lists are always escaped.
Comments
Posted by Martin Hujer (mhujer) on 2008-03-16T06:09:56.000+0000
Duplicity of ZF-2527
Posted by Martin Hujer (mhujer) on 2008-03-16T06:16:03.000+0000
It is already fixed in 1.5.0RC3 and in trunk.
Posted by Martin Hujer (mhujer) on 2008-03-16T06:38:32.000+0000
Sorry, it was a mistake, I got confused with ZF-2527.
This is not fixed.
The code between 58-69 need some comments, It is not 100%-ly clean; especially:
58: foreach ($items as $item) { if (!is_array($item)) { if ($escape) $item = $this->view->escape($item); $list .= '
' . $item . ''; } else { if (5 < strlen($list)) { $list = substr($list, 0, strlen($list) - 5) . $this->htmlList($item, $ordered, $attribs, $escape) . ''; } else { $list .= '' . $this->htmlList($item, $ordered) . ''; } } } ```Posted by Martin Hujer (mhujer) on 2008-03-16T06:39:48.000+0000
It is related, but doesn't duplicate it.
Posted by Harro van der Klauw (oximoron) on 2008-03-16T06:48:15.000+0000
The Unit test for this item fails to notice this bug because all the item arrays build there all start with a single value, the issue only occurs when the first item in the array is also an array.
Issue ZF-2527 has a diff attached that did properly fix the problem. Line 66 needs to have the attribs and escape added.
Posted by Wil Sinclair (wil) on 2008-03-25T20:33:30.000+0000
Please categorize/fix as needed.
Posted by Wil Sinclair (wil) on 2008-03-25T22:06:45.000+0000
Resetting 'fix version priority' and 'fix version' to be re-evaluated for next release.
Posted by Matthew Weier O'Phinney (matthew) on 2008-04-22T11:25:06.000+0000
Scheduling for next mini release.
Posted by Matthew Weier O'Phinney (matthew) on 2008-05-02T12:19:41.000+0000
Resolved in trunk and 1.5 release branch