#41 closed defect (bug) (fixed)
apply_filters()/remove_filter() Bug
| Reported by: | Agent Orange | Owned by: | ryan |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | |
| Severity: | major | Keywords: | |
| Cc: | Focuses: |
Description
I didn't like my comments to be altered by the wpautop-filter. To disable it I put a remove_filter('comment_text','wpautop') into my wp-comments.php. Now, that didn't work because Wordpress sorts the filters into different priorities in a very strange way. Because of this you need to tell remove_filter() in which priority it has to remove the filter. So the correct code for removing wpautop is remove_filter('comment_text', 'wpautop', 30).
Here's the bug: In priority class 30 theres only wpautop but if you remove it, the priority class stays in the array, pointing to null. When apply_filters() is called, it looks for the array of priorities for a certain text-identifier and executes a foreach($functions as $function). If the priority class is empty, $functions is a null-pointer here, and foreach outputs an error and halts the execution of the script.
See the original and corrected code in the attached file
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Already fixed in CVS.
http://wordpress.org/pipermail/cvs_wordpress.org/2004-June/000066.html