[wp-trac] [WordPress Trac] #10802: XMLRPC content_save_pre redundant when calling wp_insert_post

WordPress Trac wp-trac at lists.automattic.com
Thu Sep 17 01:27:06 UTC 2009


#10802: XMLRPC content_save_pre redundant when calling wp_insert_post
--------------------------+-------------------------------------------------
 Reporter:  redsweater    |       Owner:            
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  General       |     Version:  2.8.4     
 Severity:  normal        |    Keywords:  has-patch 
--------------------------+-------------------------------------------------
 xmlrpc.php currently calls the content_save_pre filter manually on the
 description of the post, before passing the post content to
 wp_insert_post.

 Since wp_insert_post always calls sanitize_post, and sanitize takes care
 to call the appropriate filters, including content_save_pre, it is
 redundant for XMLRPC to manually call them before calling wp_insert_post.

 Furthermore, if a filter is installed which has a "non-terminal" filtering
 effect, the xmlrpc.php redundant filter call causes corruption of post
 content, by causing the filter to transform the text once as expected, and
 then transform it again to an unexpected/undesired state.

 An example of a plugin that has a non-terminal filter is the popular
 SyntaxHighlighter Evolved plugin:

 http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/

 Users who rely on this plugin currently cannot use remote editors via the
 XMLRPC interface, because their content gets doubly filtered and turned
 unreadable.

 I am attaching a patch which simple removes the call to the filter in
 question, counting on the subsequent wp_insert_post to do the sanitizing,
 and therefore the desired filtering.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10802>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list