Changeset 5009 for trunk/includes/topics/functions.php
- Timestamp:
- 07/04/2013 12:11:09 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/includes/topics/functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/topics/functions.php
r5002 r5009 189 189 /** Topic Forum ***********************************************************/ 190 190 191 // Forum id was not passed 192 if ( empty( $_POST['bbp_forum_id'] ) ) { 193 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>ERROR</strong>: Forum ID is missing.', 'bbpress' ) ); 194 195 // Forum id was passed 196 } elseif ( is_numeric( $_POST['bbp_forum_id'] ) ) { 197 $forum_id = (int) $_POST['bbp_forum_id']; 191 // Error check the POST'ed topic id 192 if ( isset( $_POST['bbp_forum_id'] ) ) { 193 194 // Empty Forum id was passed 195 if ( empty( $_POST['bbp_forum_id'] ) ) { 196 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>ERROR</strong>: Forum ID is missing.', 'bbpress' ) ); 197 198 // Forum id is not a number 199 } elseif ( ! is_numeric( $_POST['bbp_forum_id'] ) ) { 200 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>ERROR</strong>: Forum ID must be a number.', 'bbpress' ) ); 201 202 // Forum id might be valid 203 } else { 204 205 // Get the forum id 206 $posted_forum_id = intval( $_POST['bbp_forum_id'] ); 207 208 // Forum id is empty 209 if ( 0 === $posted_forum_id ) { 210 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>ERROR</strong>: Forum ID is missing.', 'bbpress' ) ); 211 212 // Forum id is a negative number 213 } elseif ( 0 > $posted_forum_id ) { 214 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>ERROR</strong>: Forum ID cannot be a negative number.', 'bbpress' ) ); 215 216 // Forum does not exist 217 } elseif ( ! get_post( $posted_forum_id ) ) { 218 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>ERROR</strong>: Forum does not exist.', 'bbpress' ) ); 219 220 // Use the POST'ed forum id 221 } else { 222 $forum_id = $posted_forum_id; 223 } 224 } 198 225 } 199 226
Note: See TracChangeset
for help on using the changeset viewer.