Make WordPress Core

Changeset 27576


Ignore:
Timestamp:
03/18/2014 12:14:48 AM (11 years ago)
Author:
nacin
Message:

Heartbeat: Hooks should always receive unslashed data.

This affects the privileged hooks; the unprivileged hooks already received unslashed data.

props johnbillion, TobiasBg.
fixes #27260.

Location:
trunk/src/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r27524 r27576  
    21202120
    21212121    if ( ! empty($_POST['data']) ) {
    2122         $data = (array) $_POST['data'];
     2122        $data = wp_unslash( (array) $_POST['data'] );
    21232123
    21242124        /**
  • trunk/src/wp-admin/includes/post.php

    r27508 r27576  
    14511451    if ( ! wp_check_post_lock( $post->ID ) && get_current_user_id() == $post->post_author && ( 'auto-draft' == $post->post_status || 'draft' == $post->post_status ) ) {
    14521452        // Drafts and auto-drafts are just overwritten by autosave for the same user if the post is not locked
    1453         return edit_post( $post_data );
     1453        return edit_post( wp_slash( $post_data ) );
    14541454    } else {
    14551455        // Non drafts or other users drafts are not overwritten. The autosave is stored in a special post revision for each user.
    1456         return wp_create_post_autosave( $post_data );
    1457     }
    1458 }
     1456        return wp_create_post_autosave( wp_slash( $post_data ) );
     1457    }
     1458}
Note: See TracChangeset for help on using the changeset viewer.