Changeset 5684
- Timestamp:
- 04/15/2015 03:06:31 PM (11 years ago)
- Location:
- trunk/src/includes
- Files:
-
- 4 edited
-
core/filters.php (modified) (1 diff)
-
forums/functions.php (modified) (5 diffs)
-
replies/functions.php (modified) (8 diffs)
-
topics/functions.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/core/filters.php
r5559 r5684 92 92 add_filter( 'bbp_get_forum_permalink', 'bbp_add_view_all' ); 93 93 94 // wp_filter_kses on new/edit topic/reply title 94 // wp_filter_kses on new/edit forum/topic/reply title 95 add_filter( 'bbp_new_forum_pre_title', 'wp_filter_kses' ); 95 96 add_filter( 'bbp_new_reply_pre_title', 'wp_filter_kses' ); 96 97 add_filter( 'bbp_new_topic_pre_title', 'wp_filter_kses' ); 98 add_filter( 'bbp_edit_forum_pre_title', 'wp_filter_kses' ); 97 99 add_filter( 'bbp_edit_reply_pre_title', 'wp_filter_kses' ); 98 100 add_filter( 'bbp_edit_topic_pre_title', 'wp_filter_kses' ); -
trunk/src/includes/forums/functions.php
r5676 r5684 87 87 * @uses bbp_set_current_anonymous_user_data() To set the anonymous user cookies 88 88 * @uses is_wp_error() To check if the value retrieved is a {@link WP_Error} 89 * @uses esc_attr() For sanitization90 89 * @uses bbp_is_forum_category() To check if the forum is a category 91 90 * @uses bbp_is_forum_closed() To check if the forum is closed … … 147 146 148 147 if ( !empty( $_POST['bbp_forum_title'] ) ) { 149 $forum_title = esc_attr( strip_tags( $_POST['bbp_forum_title'] ));148 $forum_title = sanitize_text_field( $_POST['bbp_forum_title'] ); 150 149 } 151 150 … … 352 351 * @uses bbp_filter_anonymous_post_data() To filter anonymous data 353 352 * @uses is_wp_error() To check if the value retrieved is a {@link WP_Error} 354 * @uses esc_attr() For sanitization355 353 * @uses bbp_is_forum_category() To check if the forum is a category 356 354 * @uses bbp_is_forum_closed() To check if the forum is closed … … 454 452 455 453 if ( !empty( $_POST['bbp_forum_title'] ) ) { 456 $forum_title = esc_attr( strip_tags( $_POST['bbp_forum_title'] ));454 $forum_title = sanitize_text_field( $_POST['bbp_forum_title'] ); 457 455 } 458 456 … … 522 520 // Revision Reason 523 521 if ( !empty( $_POST['bbp_forum_edit_reason'] ) ) 524 $forum_edit_reason = esc_attr( strip_tags( $_POST['bbp_forum_edit_reason'] ));522 $forum_edit_reason = sanitize_text_field( $_POST['bbp_forum_edit_reason'] ); 525 523 526 524 // Update revision log -
trunk/src/includes/replies/functions.php
r5676 r5684 90 90 * @uses is_wp_error() To check if the value retrieved is a {@link WP_Error} 91 91 * @uses remove_filter() To remove kses filters if needed 92 * @uses esc_attr() For sanitization93 92 * @uses bbp_check_for_flood() To check for flooding 94 93 * @uses bbp_check_for_duplicate() To check for duplicates … … 263 262 264 263 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'] ); 266 265 } 267 266 … … 330 329 // Either replace terms 331 330 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'] ); 333 332 334 333 // ...or remove them. … … 472 471 * @uses is_wp_error() To check if the value retrieved is a {@link WP_Error} 473 472 * @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 479 475 * @uses wp_set_post_terms() To set the topic tags 480 476 * @uses bbp_has_errors() To get the {@link WP_Error} errors … … 600 596 601 597 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'] ); 603 599 } 604 600 … … 652 648 // Either replace terms 653 649 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'] ); 655 651 656 652 // ...or remove them. … … 718 714 // Revision Reason 719 715 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'] ); 721 717 } 722 718 … … 1384 1380 // Use the new title that was passed 1385 1381 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'] ); 1387 1383 1388 1384 // Use the source topic title -
trunk/src/includes/topics/functions.php
r5676 r5684 92 92 * @uses bbp_set_current_anonymous_user_data() To set the anonymous user cookies 93 93 * @uses is_wp_error() To check if the value retrieved is a {@link WP_Error} 94 * @uses esc_attr() For sanitization95 94 * @uses bbp_is_forum_category() To check if the forum is a category 96 95 * @uses bbp_is_forum_closed() To check if the forum is closed … … 175 174 176 175 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'] ); 178 177 } 179 178 … … 306 305 307 306 // Escape tag input 308 $terms = esc_attr( strip_tags( $_POST['bbp_topic_tags'] ));307 $terms = sanitize_text_field( $_POST['bbp_topic_tags'] ); 309 308 310 309 // Explode by comma … … 464 463 * @uses bbp_filter_anonymous_post_data() To filter anonymous data 465 464 * @uses is_wp_error() To check if the value retrieved is a {@link WP_Error} 466 * @uses esc_attr() For sanitization467 465 * @uses bbp_is_forum_category() To check if the forum is a category 468 466 * @uses bbp_is_forum_closed() To check if the forum is closed … … 600 598 601 599 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'] ); 603 601 } 604 602 … … 656 654 657 655 // Escape tag input 658 $terms = esc_attr( strip_tags( $_POST['bbp_topic_tags'] ));656 $terms = sanitize_text_field( $_POST['bbp_topic_tags'] ); 659 657 660 658 // Explode by comma … … 725 723 // Revision Reason 726 724 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'] ); 728 726 } 729 727 … … 1558 1556 // Use the new title that was passed 1559 1557 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'] ); 1561 1559 1562 1560 // Use the source topic title
Note: See TracChangeset
for help on using the changeset viewer.