Changeset 5558 for trunk/src/includes/forums/template.php
- Timestamp:
- 11/10/2014 05:37:29 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/forums/template.php
r5501 r5558 2185 2185 2186 2186 // Get _POST data 2187 if ( bbp_is_ post_request() && isset( $_POST['bbp_forum_title'] ) ) {2187 if ( bbp_is_forum_form_post_request() && isset( $_POST['bbp_forum_title'] ) ) { 2188 2188 $forum_title = $_POST['bbp_forum_title']; 2189 2189 … … 2222 2222 2223 2223 // Get _POST data 2224 if ( bbp_is_ post_request() && isset( $_POST['bbp_forum_content'] ) ) {2224 if ( bbp_is_forum_form_post_request() && isset( $_POST['bbp_forum_content'] ) ) { 2225 2225 $forum_content = stripslashes( $_POST['bbp_forum_content'] ); 2226 2226 … … 2260 2260 2261 2261 // Get _POST data 2262 if ( bbp_is_ post_request() && isset( $_POST['bbp_forum_id'] ) ) {2262 if ( bbp_is_forum_form_post_request() && isset( $_POST['bbp_forum_id'] ) ) { 2263 2263 $forum_parent = $_POST['bbp_forum_id']; 2264 2264 … … 2298 2298 2299 2299 // Get _POST data 2300 if ( bbp_is_ post_request() && isset( $_POST['bbp_forum_type'] ) ) {2300 if ( bbp_is_forum_form_post_request() && isset( $_POST['bbp_forum_type'] ) ) { 2301 2301 $forum_type = $_POST['bbp_forum_type']; 2302 2302 … … 2336 2336 2337 2337 // Get _POST data 2338 if ( bbp_is_ post_request() && isset( $_POST['bbp_forum_visibility'] ) ) {2338 if ( bbp_is_forum_form_post_request() && isset( $_POST['bbp_forum_visibility'] ) ) { 2339 2339 $forum_visibility = $_POST['bbp_forum_visibility']; 2340 2340 … … 2378 2378 2379 2379 // Get _POST data 2380 if ( bbp_is_ post_request() && isset( $_POST['bbp_forum_subscription'] ) ) {2380 if ( bbp_is_forum_form_post_request() && isset( $_POST['bbp_forum_subscription'] ) ) { 2381 2381 $forum_subscribed = (bool) $_POST['bbp_forum_subscription']; 2382 2382 … … 2465 2465 2466 2466 // Post value is passed 2467 if ( bbp_is_ post_request() && isset( $_POST[ $r['select_id'] ] ) ) {2467 if ( bbp_is_forum_form_post_request() && isset( $_POST[ $r['select_id'] ] ) ) { 2468 2468 $r['selected'] = $_POST[ $r['select_id'] ]; 2469 2469 … … 2557 2557 2558 2558 // Post value is passed 2559 if ( bbp_is_ post_request() && isset( $_POST[ $r['select_id'] ] ) ) {2559 if ( bbp_is_forum_form_post_request() && isset( $_POST[ $r['select_id'] ] ) ) { 2560 2560 $r['selected'] = $_POST[ $r['select_id'] ]; 2561 2561 … … 2649 2649 2650 2650 // Post value is passed 2651 if ( bbp_is_ post_request() && isset( $_POST[ $r['select_id'] ] ) ) {2651 if ( bbp_is_forum_form_post_request() && isset( $_POST[ $r['select_id'] ] ) ) { 2652 2652 $r['selected'] = $_POST[ $r['select_id'] ]; 2653 2653 … … 2688 2688 return apply_filters( 'bbp_get_form_forum_type_dropdown', ob_get_clean(), $r ); 2689 2689 } 2690 2691 /** 2692 * Verify if a POST request came from a failed forum attempt. 2693 * 2694 * Used to avoid cross-site request forgeries when checking posted forum form 2695 * content. 2696 * 2697 * @see bbp_forum_form_fields() 2698 * 2699 * @since bbPress (r5558) 2700 * @return boolean True if is a post request with valid nonce 2701 */ 2702 function bbp_is_forum_form_post_request() { 2703 2704 // Bail if not a post request 2705 if ( ! bbp_is_post_request() ) { 2706 return false; 2707 } 2708 2709 // Creating a new topic 2710 if ( bbp_verify_nonce_request( 'bbp-new-forum' ) ) { 2711 return true; 2712 } 2713 2714 // Editing an existing topic 2715 if ( bbp_verify_nonce_request( 'bbp-edit-forum' ) ) { 2716 return true; 2717 } 2718 2719 return false; 2720 } 2690 2721 2691 2722 /** Feeds *********************************************************************/
Note: See TracChangeset
for help on using the changeset viewer.