[wp-trac] [WordPress Trac] #16306: clear output buffer before xml responses to prevent whitespace

WordPress Trac wp-trac at lists.automattic.com
Thu Jan 20 14:34:40 UTC 2011


#16306: clear output buffer before xml responses to prevent whitespace
--------------------------+------------------------------
 Reporter:  ps2602        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  3.0.4
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by ps2602):

 For some reason, there are a quite a few plugins that output white space
 which breaks xml parsing in all browsers.  I keep coming across this
 problem in both ms-files.php and now the send method of the
 WP_Ajax_Response class so I just added ob_clean to the method in order to
 prevent plugins from being able to inadvertently break functionality in
 wordpress.  I read up on ticket #14730 and I understand the viewpoint that
 ob_clean should not be used to cover the mistakes of plugin authors.
 However, finding unnecessary output in a plugin and contacting the author
 every time I come across this issue (which seems to happen often) seems
 counter-productive when users can be protected from such mistakes with a
 one-liner.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16306#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list