Ticket #3570: 3570.patch
File 3570.patch, 7.1 KB (added by , 22 months ago) |
---|
-
includes/common/functions.php
46 46 47 47 // Check 'redirect_to' request parameter 48 48 $retval = ! empty( $_REQUEST['redirect_to'] ) 49 ? $_REQUEST['redirect_to']49 ? sanitize_text_field( $_REQUEST['redirect_to'] ) 50 50 : ''; 51 51 52 52 // Filter & return … … 590 590 591 591 // Parse arguments against default values 592 592 $r = bbp_parse_args( $args, array( 593 'bbp_anonymous_name' => ! empty( $_POST['bbp_anonymous_name'] ) ? $_POST['bbp_anonymous_name']: false,594 'bbp_anonymous_email' => ! empty( $_POST['bbp_anonymous_email'] ) ? $_POST['bbp_anonymous_email']: false,595 'bbp_anonymous_website' => ! empty( $_POST['bbp_anonymous_website'] ) ? $_POST['bbp_anonymous_website']: false,593 'bbp_anonymous_name' => ! empty( $_POST['bbp_anonymous_name'] ) ? sanitize_text_field( $_POST['bbp_anonymous_name'] ) : false, 594 'bbp_anonymous_email' => ! empty( $_POST['bbp_anonymous_email'] ) ? sanitize_text_field( $_POST['bbp_anonymous_email'] ) : false, 595 'bbp_anonymous_website' => ! empty( $_POST['bbp_anonymous_website'] ) ? sanitize_text_field( $_POST['bbp_anonymous_website'] ) : false, 596 596 ), 'filter_anonymous_post_data' ); 597 597 598 598 // Strip invalid characters … … 1038 1038 * @return string 1039 1039 */ 1040 1040 function bbp_get_do_not_reply_address() { 1041 $sitename = strtolower( $_SERVER['SERVER_NAME']);1041 $sitename = strtolower( sanitize_text_field( $_SERVER['SERVER_NAME'] ) ); 1042 1042 if ( substr( $sitename, 0, 4 ) === 'www.' ) { 1043 1043 $sitename = substr( $sitename, 4 ); 1044 1044 } -
includes/core/abstraction.php
217 217 * 218 218 * @since 2.5.8 bbPress (r5814) 219 219 * 220 * @global object $wp_rewrite The WP_Rewrite object221 220 * 222 221 * @return bool 223 222 */ -
includes/extend/akismet.php
1025 1025 * 1026 1026 * @since 2.6.7 bbPress (r7203) 1027 1027 * 1028 * @global wpdb $wpdb 1028 * @global wpdb $wpdb WordPress database object. 1029 1029 */ 1030 1030 public function delete_old_spam() { 1031 1031 global $wpdb; … … 1106 1106 * 1107 1107 * @since 2.6.7 bbPress (r7203) 1108 1108 * 1109 * @global wpdb $wpdb 1109 * @global wpdb $wpdb WordPress database object. 1110 1110 */ 1111 1111 public function delete_old_spam_meta() { 1112 1112 global $wpdb; … … 1166 1166 * 1167 1167 * @since 2.6.7 bbPress (r7203) 1168 1168 * 1169 * @global wpdb $wpdb 1169 * @global wpdb $wpdb WordPress database object. 1170 1170 */ 1171 1171 public function delete_orphaned_spam_meta() { 1172 1172 global $wpdb; … … 1250 1250 * 1251 1251 * @since 2.7.0 bbPress (r7203) 1252 1252 * 1253 * @global wpdb $wpdb 1253 * @global wpdb $wpdb WordPress database object. 1254 1254 */ 1255 1255 private function maybe_optimize_postmeta() { 1256 1256 global $wpdb; -
includes/forums/functions.php
173 173 /** Forum Content *********************************************************/ 174 174 175 175 if ( ! empty( $_POST['bbp_forum_content'] ) ) { 176 $forum_content = $_POST['bbp_forum_content'];176 $forum_content = sanitize_text_field( $_POST['bbp_forum_content'] ); 177 177 } 178 178 179 179 // Filter and sanitize … … 188 188 189 189 // Forum parent was passed (the norm) 190 190 if ( ! empty( $_POST['bbp_forum_parent_id'] ) ) { 191 $forum_parent_id = bbp_get_forum_id( $_POST['bbp_forum_parent_id']);191 $forum_parent_id = bbp_get_forum_id( sanitize_text_field( $_POST['bbp_forum_parent_id'] ) ); 192 192 } 193 193 194 194 // Filter and sanitize … … 426 426 427 427 // Forum parent id was passed 428 428 if ( ! empty( $_POST['bbp_forum_parent_id'] ) ) { 429 $forum_parent_id = bbp_get_forum_id( $_POST['bbp_forum_parent_id']);429 $forum_parent_id = bbp_get_forum_id( sanitize_text_field( $_POST['bbp_forum_parent_id'] ) ); 430 430 } 431 431 432 432 // Current forum this forum is in … … 473 473 /** Forum Content *********************************************************/ 474 474 475 475 if ( ! empty( $_POST['bbp_forum_content'] ) ) { 476 $forum_content = $_POST['bbp_forum_content'];476 $forum_content = sanitize_text_field( $_POST['bbp_forum_content'] ); 477 477 } 478 478 479 479 // Filter and sanitize -
includes/forums/template.php
2110 2110 2111 2111 // Get _POST data 2112 2112 if ( bbp_is_forum_form_post_request() && isset( $_POST['bbp_forum_content'] ) ) { 2113 $forum_content = wp_unslash( $_POST['bbp_forum_content']);2113 $forum_content = wp_unslash( sanitize_text_field( $_POST['bbp_forum_content'] ) ); 2114 2114 2115 2115 // Get edit data 2116 2116 } elseif ( bbp_is_forum_edit() ) { -
includes/topics/functions.php
166 166 /** Topic Content *********************************************************/ 167 167 168 168 if ( ! empty( $_POST['bbp_topic_content'] ) ) { 169 $topic_content = $_POST['bbp_topic_content'];169 $topic_content = sanitize_text_field( $_POST['bbp_topic_content'] ); 170 170 } 171 171 172 172 // Filter and sanitize … … 553 553 /** Topic Content *********************************************************/ 554 554 555 555 if ( ! empty( $_POST['bbp_topic_content'] ) ) { 556 $topic_content = $_POST['bbp_topic_content'];556 $topic_content = sanitize_text_field( $_POST['bbp_topic_content'] ); 557 557 } 558 558 559 559 // Filter and sanitize … … 1742 1742 } 1743 1743 1744 1744 // Attempt to update the tag 1745 $slug = ! empty( $_POST['tag-slug'] ) ? $_POST['tag-slug']: '';1746 $description = ! empty( $_POST['tag-description'] ) ? $_POST['tag-description']: '';1745 $slug = ! empty( $_POST['tag-slug'] ) ? sanitize_text_field( $_POST['tag-slug'] ) : ''; 1746 $description = ! empty( $_POST['tag-description'] ) ? sanitize_text_field( $_POST['tag-description'] ) : ''; 1747 1747 $tag = wp_update_term( $tag_id, bbp_get_topic_tag_tax_id(), array( 1748 1748 'name' => $name, 1749 1749 'slug' => $slug, -
includes/users/engagements.php
600 600 } 601 601 602 602 // What action is taking place? 603 $topic_id = bbp_get_topic_id( $_GET['object_id']);603 $topic_id = bbp_get_topic_id( sanitize_text_field( $_GET['object_id'] ) ); 604 604 $user_id = bbp_get_user_id( 0, true, true ); 605 605 606 606 // Check for empty topic … … 637 637 638 638 // Redirect back from whence we came 639 639 if ( ! empty( $_REQUEST['redirect_to'] ) ) { 640 $redirect = $_REQUEST['redirect_to']; // Validated later640 $redirect = sanitize_text_field( $_REQUEST['redirect_to'] ); // Validated later 641 641 } elseif ( bbp_is_favorites() ) { 642 642 $redirect = bbp_get_favorites_permalink( $user_id, true ); 643 643 } elseif ( bbp_is_single_user() ) {