mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-06 02:41:27 +01:00
Escape before passing to insert/update post. Props hailin. fixes #9199 for 2.7
git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7a92c50bf0
commit
219ce056c2
@ -3456,6 +3456,7 @@ function _wp_put_post_revision( $post = null, $autosave = false ) {
|
|||||||
return new WP_Error( 'post_type', __( 'Cannot create a revision of a revision' ) );
|
return new WP_Error( 'post_type', __( 'Cannot create a revision of a revision' ) );
|
||||||
|
|
||||||
$post = _wp_post_revision_fields( $post, $autosave );
|
$post = _wp_post_revision_fields( $post, $autosave );
|
||||||
|
$post = add_magic_quotes($post); //since data is from db
|
||||||
|
|
||||||
$revision_id = wp_insert_post( $post );
|
$revision_id = wp_insert_post( $post );
|
||||||
if ( is_wp_error($revision_id) )
|
if ( is_wp_error($revision_id) )
|
||||||
@ -3533,6 +3534,8 @@ function wp_restore_post_revision( $revision_id, $fields = null ) {
|
|||||||
|
|
||||||
$update['ID'] = $revision['post_parent'];
|
$update['ID'] = $revision['post_parent'];
|
||||||
|
|
||||||
|
$update = add_magic_quotes( $update ); //since data is from db
|
||||||
|
|
||||||
$post_id = wp_update_post( $update );
|
$post_id = wp_update_post( $update );
|
||||||
if ( is_wp_error( $post_id ) )
|
if ( is_wp_error( $post_id ) )
|
||||||
return $post_id;
|
return $post_id;
|
||||||
|
Loading…
Reference in New Issue
Block a user