Skip to:
Content

bbPress.org


Ignore:
Timestamp:
04/15/2015 03:06:31 PM (12 years ago)
Author:
johnjamesjacoby
Message:

General: Use sanitize_text_field() in lieu of old-bbPress style pre-escaping technique.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/replies/functions.php

    r5676 r5684  
    9090 * @uses is_wp_error() To check if the value retrieved is a {@link WP_Error}
    9191 * @uses remove_filter() To remove kses filters if needed
    92  * @uses esc_attr() For sanitization
    9392 * @uses bbp_check_for_flood() To check for flooding
    9493 * @uses bbp_check_for_duplicate() To check for duplicates
    … …  
    263262
    264263        if ( !empty( $_POST['bbp_reply_title'] ) ) {
    265                 $reply_title = esc_attr( strip_tags( $_POST['bbp_reply_title'] ) );
     264                $reply_title = sanitize_text_field( $_POST['bbp_reply_title'] );
    266265        }
    267266
    … …  
    330329        // Either replace terms
    331330        if ( bbp_allow_topic_tags() && current_user_can( 'assign_topic_tags' ) && ! empty( $_POST['bbp_topic_tags'] ) ) {
    332                 $terms = esc_attr( strip_tags( $_POST['bbp_topic_tags'] ) );
     331                $terms = sanitize_text_field( $_POST['bbp_topic_tags'] );
    333332
    334333        // ...or remove them.
    … …  
    472471 * @uses is_wp_error() To check if the value retrieved is a {@link WP_Error}
    473472 * @uses remove_filter() To remove kses filters if needed
    474  * @uses esc_attr() For sanitization
    475  * @uses apply_filters() Calls 'bbp_edit_reply_pre_title' with the title and
    476  *                       reply id
    477  * @uses apply_filters() Calls 'bbp_edit_reply_pre_content' with the content
    478  *                        reply id
     473 * @uses apply_filters() Calls 'bbp_edit_reply_pre_title' with the title and id
     474 * @uses apply_filters() Calls 'bbp_edit_reply_pre_content' with the content id
    479475 * @uses wp_set_post_terms() To set the topic tags
    480476 * @uses bbp_has_errors() To get the {@link WP_Error} errors
    … …  
    600596
    601597        if ( !empty( $_POST['bbp_reply_title'] ) ) {
    602                 $reply_title = esc_attr( strip_tags( $_POST['bbp_reply_title'] ) );
     598                $reply_title = sanitize_text_field( $_POST['bbp_reply_title'] );
    603599        }
    604600
    … …  
    652648        // Either replace terms
    653649        if ( bbp_allow_topic_tags() && current_user_can( 'assign_topic_tags' ) && ! empty( $_POST['bbp_topic_tags'] ) ) {
    654                 $terms = esc_attr( strip_tags( $_POST['bbp_topic_tags'] ) );
     650                $terms = sanitize_text_field( $_POST['bbp_topic_tags'] );
    655651
    656652        // ...or remove them.
    … …  
    718714        // Revision Reason
    719715        if ( !empty( $_POST['bbp_reply_edit_reason'] ) ) {
    720                 $reply_edit_reason = esc_attr( strip_tags( $_POST['bbp_reply_edit_reason'] ) );
     716                $reply_edit_reason = sanitize_text_field( $_POST['bbp_reply_edit_reason'] );
    721717        }
    722718
    … …  
    13841380                                        // Use the new title that was passed
    13851381                                        if ( !empty( $_POST['bbp_reply_move_destination_title'] ) ) {
    1386                                                 $destination_topic_title = esc_attr( strip_tags( $_POST['bbp_reply_move_destination_title'] ) );
     1382                                                $destination_topic_title = sanitize_text_field( $_POST['bbp_reply_move_destination_title'] );
    13871383
    13881384                                        // Use the source topic title
Note: See TracChangeset for help on using the changeset viewer.