#41 closed defect (bug) (fixed)
apply_filters()/remove_filter() Bug
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | major | Version: | |
Component: | General | Keywords: | |
Focuses: | Cc: |
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
Attachments (1)
Change History (6)
#2
@
21 years ago
- Owner changed from anonymous to rboren
- Resolution changed from 10 to 20
- Status changed from new to closed
Already fixed in CVS.
http://wordpress.org/pipermail/cvs_wordpress.org/2004-June/000066.html