From 1b4ac5206d207052045b3473f23d0a442f971301 Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 22 Feb 2009 00:35:42 +0000 Subject: [PATCH] Escape before passing to insert/update post. Props hailin. fixes #9199 for trunk git-svn-id: http://svn.automattic.com/wordpress/trunk@10620 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index f50d954449..0c83662929 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -3507,7 +3507,8 @@ function _wp_put_post_revision( $post = null, $autosave = false ) { return new WP_Error( 'post_type', __( 'Cannot create a revision of a revision' ) ); $post = _wp_post_revision_fields( $post, $autosave ); - + $post = add_magic_quotes($post); //since data is from db + $revision_id = wp_insert_post( $post ); if ( is_wp_error($revision_id) ) return $revision_id; @@ -3583,6 +3584,8 @@ function wp_restore_post_revision( $revision_id, $fields = null ) { return false; $update['ID'] = $revision['post_parent']; + + $update = add_magic_quotes( $update ); //since data is from db $post_id = wp_update_post( $update ); if ( is_wp_error( $post_id ) )