XMLRPC content_save_pre redundant when calling wp_insert_post
|Reported by:||redsweater||Owned by:||josephscott|
Description (last modified by ryan)
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:
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.
Change History (5)
- Component changed from General to XML-RPC
- Description modified (diff)
- Milestone changed from Unassigned to 2.9
- Owner set to josephscott