﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
21169	remove_action on a tag within do_action for that tag can cause actions to be missed	devesine		"'''Problem:'''

If an action (or filter) in a given priority for a given tag removes itself as part of its execution, and it was the only action/filter at that priority for that tag (or only one remaining), the next priority level is skipped.

'''Reproduction:'''

See the attached unit test.

'''Analysis:'''

This appears to possibly be a bug (or at least an undocumented feature) of PHP (tested up to 5.4.3), where next() falls over if the current array element is unset (but each() has no problem even if the /next/ array element is unset).  Example non-WP code demonstrating this is included.

'''Proposed solution / workaround:'''

Switch all uses of next() in plugin.php to use each() instead; I've included a proposed patch.

Props to smathiascrowdfavorite for bringing this bug to my attention."	defect (bug)	new	normal	Future Release	Plugins		major		has-patch needs-testing 3.6-early	
