- Timestamp:
- 11/08/2016 05:54:22 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r39126 r39155 489 489 490 490 $post->post_type = $this->post_type; 491 $post_id = wp_insert_post( $post, true );491 $post_id = wp_insert_post( wp_slash( (array) $post ), true ); 492 492 493 493 if ( is_wp_error( $post_id ) ) { … … 629 629 630 630 // convert the post object to an array, otherwise wp_update_post will expect non-escaped input. 631 $post_id = wp_update_post( (array) $post, true );631 $post_id = wp_update_post( wp_slash( (array) $post ), true ); 632 632 633 633 if ( is_wp_error( $post_id ) ) { … … 970 970 if ( ! empty( $schema['properties']['title'] ) && isset( $request['title'] ) ) { 971 971 if ( is_string( $request['title'] ) ) { 972 $prepared_post->post_title = wp_filter_post_kses( $request['title'] );972 $prepared_post->post_title = $request['title']; 973 973 } elseif ( ! empty( $request['title']['raw'] ) ) { 974 $prepared_post->post_title = wp_filter_post_kses( $request['title']['raw'] );974 $prepared_post->post_title = $request['title']['raw']; 975 975 } 976 976 } … … 979 979 if ( ! empty( $schema['properties']['content'] ) && isset( $request['content'] ) ) { 980 980 if ( is_string( $request['content'] ) ) { 981 $prepared_post->post_content = wp_filter_post_kses( $request['content'] );981 $prepared_post->post_content = $request['content']; 982 982 } elseif ( isset( $request['content']['raw'] ) ) { 983 $prepared_post->post_content = wp_filter_post_kses( $request['content']['raw'] );983 $prepared_post->post_content = $request['content']['raw']; 984 984 } 985 985 } … … 988 988 if ( ! empty( $schema['properties']['excerpt'] ) && isset( $request['excerpt'] ) ) { 989 989 if ( is_string( $request['excerpt'] ) ) { 990 $prepared_post->post_excerpt = wp_filter_post_kses( $request['excerpt'] );990 $prepared_post->post_excerpt = $request['excerpt']; 991 991 } elseif ( isset( $request['excerpt']['raw'] ) ) { 992 $prepared_post->post_excerpt = wp_filter_post_kses( $request['excerpt']['raw'] );992 $prepared_post->post_excerpt = $request['excerpt']['raw']; 993 993 } 994 994 }
Note: See TracChangeset
for help on using the changeset viewer.