Changeset 9392
- Timestamp:
- 01/21/2015 07:42:11 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-moderation.php
r9351 r9392 32 32 33 33 // Option disabled. No flood checks. 34 if ( !$throttle_time = bp_get_option( '_bp_throttle_time' ) ) 35 return true; 34 if ( !$throttle_time = bp_get_option( '_bp_throttle_time' ) ) { 35 return true; 36 } 36 37 37 38 // Bail if no user ID passed 38 if ( empty( $user_id ) ) 39 if ( empty( $user_id ) ) { 39 40 return false; 41 } 40 42 41 43 $last_posted = get_user_meta( $user_id, '_bp_last_posted', true ); 42 if ( isset( $last_posted ) && ( time() < ( $last_posted + $throttle_time ) ) && !current_user_can( 'throttle' ) ) 44 if ( isset( $last_posted ) && ( time() < ( $last_posted + $throttle_time ) ) && !current_user_can( 'throttle' ) ) { 43 45 return false; 46 } 44 47 45 48 return true; … … 63 66 64 67 // Bail if super admin is author 65 if ( is_super_admin( $user_id ) ) 66 return true; 68 if ( is_super_admin( $user_id ) ) { 69 return true; 70 } 67 71 68 72 // Define local variable(s) … … 70 74 $match_out = ''; 71 75 72 /** Blacklist *************************************************************/73 74 // Get the moderation keys75 $blacklist = trim( get_option( 'moderation_keys' ) );76 77 // Bail if blacklist is empty78 if ( empty( $blacklist ) )79 return true;80 81 76 /** User Data *************************************************************/ 82 77 83 if ( ! empty( $user_id ) ) {78 if ( ! empty( $user_id ) ) { 84 79 85 80 // Get author data … … 87 82 88 83 // If data exists, map it 89 if ( ! empty( $user ) ) {84 if ( ! empty( $user ) ) { 90 85 $post['author'] = $user->display_name; 91 86 $post['email'] = $user->user_email; … … 105 100 106 101 $max_links = get_option( 'comment_max_links' ); 107 if ( ! empty( $max_links ) ) {102 if ( ! empty( $max_links ) ) { 108 103 109 104 // How many links? … … 117 112 return false; 118 113 } 114 } 115 116 /** Blacklist *************************************************************/ 117 118 // Get the moderation keys 119 $blacklist = trim( get_option( 'moderation_keys' ) ); 120 121 // Bail if blacklist is empty 122 if ( empty( $blacklist ) ) { 123 return true; 119 124 } 120 125 … … 171 176 172 177 // Bail if super admin is author 173 if ( is_super_admin( $user_id ) ) 174 return true; 178 if ( is_super_admin( $user_id ) ) { 179 return true; 180 } 175 181 176 182 // Define local variable 177 183 $post = array(); 178 184 179 /** Blacklist *************************************************************/180 181 // Get the moderation keys182 $blacklist = trim( get_option( 'blacklist_keys' ) );183 184 // Bail if blacklist is empty185 if ( empty( $blacklist ) )186 return true;187 188 185 /** User Data *************************************************************/ 189 186 190 187 // Map current user data 191 if ( ! empty( $user_id ) ) {188 if ( ! empty( $user_id ) ) { 192 189 193 190 // Get author data … … 195 192 196 193 // If data exists, map it 197 if ( ! empty( $user ) ) {194 if ( ! empty( $user ) ) { 198 195 $post['author'] = $user->display_name; 199 196 $post['email'] = $user->user_email; … … 210 207 $post['content'] = $content; 211 208 209 /** Blacklist *************************************************************/ 210 211 // Get the moderation keys 212 $blacklist = trim( get_option( 'blacklist_keys' ) ); 213 214 // Bail if blacklist is empty 215 if ( empty( $blacklist ) ) { 216 return true; 217 } 218 212 219 /** Words *****************************************************************/ 213 220 … … 267 274 268 275 // Sanity check the user agent 269 if ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) )276 if ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) ) { 270 277 $retval = substr( $_SERVER['HTTP_USER_AGENT'], 0, 254 ); 271 else278 } else { 272 279 $retval = ''; 280 } 273 281 274 282 return apply_filters( 'bp_core_current_user_ua', $retval );
Note: See TracChangeset
for help on using the changeset viewer.