Skip to:
Content

bbPress.org


Ignore:
Timestamp:
04/15/2015 03:06:31 PM (11 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/topics/functions.php

    r5676 r5684  
    9292 * @uses bbp_set_current_anonymous_user_data() To set the anonymous user cookies
    9393 * @uses is_wp_error() To check if the value retrieved is a {@link WP_Error}
    94  * @uses esc_attr() For sanitization
    9594 * @uses bbp_is_forum_category() To check if the forum is a category
    9695 * @uses bbp_is_forum_closed() To check if the forum is closed
     
    175174
    176175    if ( ! empty( $_POST['bbp_topic_title'] ) ) {
    177         $topic_title = esc_attr( strip_tags( $_POST['bbp_topic_title'] ) );
     176        $topic_title = sanitize_text_field( $_POST['bbp_topic_title'] );
    178177    }
    179178
     
    306305
    307306        // Escape tag input
    308         $terms = esc_attr( strip_tags( $_POST['bbp_topic_tags'] ) );
     307        $terms = sanitize_text_field( $_POST['bbp_topic_tags'] );
    309308
    310309        // Explode by comma
     
    464463 * @uses bbp_filter_anonymous_post_data() To filter anonymous data
    465464 * @uses is_wp_error() To check if the value retrieved is a {@link WP_Error}
    466  * @uses esc_attr() For sanitization
    467465 * @uses bbp_is_forum_category() To check if the forum is a category
    468466 * @uses bbp_is_forum_closed() To check if the forum is closed
     
    600598
    601599    if ( ! empty( $_POST['bbp_topic_title'] ) ) {
    602         $topic_title = esc_attr( strip_tags( $_POST['bbp_topic_title'] ) );
     600        $topic_title = sanitize_text_field( $_POST['bbp_topic_title'] );
    603601    }
    604602
     
    656654
    657655        // Escape tag input
    658         $terms = esc_attr( strip_tags( $_POST['bbp_topic_tags'] ) );
     656        $terms = sanitize_text_field( $_POST['bbp_topic_tags'] );
    659657
    660658        // Explode by comma
     
    725723        // Revision Reason
    726724        if ( ! empty( $_POST['bbp_topic_edit_reason'] ) ) {
    727             $topic_edit_reason = esc_attr( strip_tags( $_POST['bbp_topic_edit_reason'] ) );
     725            $topic_edit_reason = sanitize_text_field( $_POST['bbp_topic_edit_reason'] );
    728726        }
    729727
     
    15581556                    // Use the new title that was passed
    15591557                    if ( ! empty( $_POST['bbp_topic_split_destination_title'] ) ) {
    1560                         $destination_topic_title = esc_attr( strip_tags( $_POST['bbp_topic_split_destination_title'] ) );
     1558                        $destination_topic_title = sanitize_text_field( $_POST['bbp_topic_split_destination_title'] );
    15611559
    15621560                    // Use the source topic title
Note: See TracChangeset for help on using the changeset viewer.