id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,focuses
10802,XMLRPC content_save_pre redundant when calling wp_insert_post,redsweater,josephscott,"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.
",defect (bug),closed,normal,2.9,XML-RPC,2.8.4,normal,fixed,has-patch,,