Changeset 13903 for trunk/src/bp-core/bp-core-moderation.php
- Timestamp:
- 06/04/2024 02:30:49 AM (20 months ago)
- File:
-
- 1 edited
-
trunk/src/bp-core/bp-core-moderation.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-moderation.php
r13878 r13903 26 26 function bp_core_check_for_flood( $user_id = 0 ) { 27 27 28 $throttle_time = bp_get_option( '_bp_throttle_time' ); 29 28 30 // Option disabled. No flood checks. 29 if ( ! $throttle_time = bp_get_option( '_bp_throttle_time' )) {31 if ( ! $throttle_time ) { 30 32 return true; 31 33 } … … 37 39 38 40 $last_posted = get_user_meta( $user_id, '_bp_last_posted', true ); 39 if ( isset( $last_posted ) && ( time() < ( $last_posted + $throttle_time ) ) && ! current_user_can( 'throttle' ) ) {41 if ( isset( $last_posted ) && ( time() < ( $last_posted + $throttle_time ) ) && ! current_user_can( 'throttle' ) ) { 40 42 return false; 41 43 } … … 79 81 // Define local variable(s). 80 82 $_post = array(); 81 $matches = '';83 $matches = array(); 82 84 83 85 /** User Data ************************************************************ … … 119 121 foreach ( $matches[0] as $found_url ) { 120 122 if ( 0 === strpos( $found_url, home_url() ) ) { 121 $num_links -=1;123 --$num_links; 122 124 } 123 125 } … … 298 300 299 301 // Skip empty lines. 300 if ( empty( $word ) ) { continue; } 302 if ( empty( $word ) ) { 303 continue; 304 } 301 305 302 306 // Do some escaping magic so that '#' chars in the … … 332 336 function bp_core_current_user_ip() { 333 337 $retval = ''; 338 334 339 if ( isset( $_SERVER['REMOTE_ADDR'] ) ) { 335 340 $retval = preg_replace( '/[^0-9a-fA-F:., ]/', '', wp_unslash( $_SERVER['REMOTE_ADDR'] ) ); … … 354 359 */ 355 360 function bp_core_current_user_ua() { 361 $retval = ''; 356 362 357 363 // Sanity check the user agent. 358 364 if ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) ) { 359 365 $retval = substr( $_SERVER['HTTP_USER_AGENT'], 0, 254 ); 360 } else {361 $retval = '';362 366 } 363 367
Note: See TracChangeset
for help on using the changeset viewer.