[wp-trac] [WordPress Trac] #28801: Walker::walk makes an incorrect assumption if $top_level_elements is empty.
WordPress Trac
noreply at wordpress.org
Sun Dec 4 20:22:55 UTC 2016
#28801: Walker::walk makes an incorrect assumption if $top_level_elements is empty.
-------------------------------------------------+-------------------------
Reporter: rob-castlegate | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting
Component: General | Review
Severity: normal | Version: 3.8
Keywords: has-patch needs-testing needs-unit- | Resolution:
tests 2nd-opinion | Focuses:
-------------------------------------------------+-------------------------
Changes (by ross_ritchey):
* keywords: needs-patch => has-patch needs-testing needs-unit-tests 2nd-
opinion
Comment:
Added a patch that handles this a bit differently. Instead of adding a new
foreach I added a third conditional to the original foreach.
To do this I had to move the $root declaration out of the fallback if,
which adds a small amount of performance overhead when there are top level
elements.
Honestly not sure right now if this is better or worse than having a third
foreach.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28801#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list