Opened 15 years ago
Closed 15 years ago
#10802 closed defect (bug) (fixed)
XMLRPC content_save_pre redundant when calling wp_insert_post
Reported by: | redsweater | Owned by: | josephscott |
---|---|---|---|
Milestone: | 2.9 | Priority: | normal |
Severity: | normal | Version: | 2.8.4 |
Component: | XML-RPC | Keywords: | has-patch |
Focuses: | Cc: |
Description (last modified by )
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.
Seems good to me. Joseph?