Changeset 5278 for trunk/bp-core/bp-core-moderation.php
- Timestamp:
- 11/05/2011 09:31:05 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-moderation.php
r5274 r5278 1 1 <?php 2 3 2 /** 4 3 * BuddyPress Moderation Functions … … 20 19 * of time. 21 20 * 22 * @since BuddyPress (1.6)23 *24 21 * @param int $user_id User id to check for flood 25 * @uses get_option() To get the throttle time 22 * @return bool True if there is no flooding, true if there is 23 * @since 1.6 24 * @uses current_user_can() To check if the current user can throttle 25 * @uses bp_get_option() To get the throttle time 26 26 * @uses get_transient() To get the last posted transient of the ip 27 27 * @uses get_user_meta() To get the last posted meta of the user 28 * @uses current_user_can() To check if the current user can throttle29 * @return bool True if there is no flooding, true if there is30 28 */ 31 29 function bp_core_check_for_flood( $user_id = 0 ) { 32 30 33 31 // Option disabled. No flood checks. 34 if ( !$throttle_time = get_option( '_bp_throttle_time' ) )32 if ( !$throttle_time = bp_get_option( '_bp_throttle_time' ) ) 35 33 return true; 36 34 … … 49 47 * Check for moderation keys and too many links 50 48 * 51 * @since BuddyPress (1.6)52 *53 49 * @param int $user_id Topic or reply author ID 54 50 * @param string $title The title of the content 55 51 * @param string $content The content being posted 52 * @return bool True if test is passed, false if fail 53 * @since 1.6 54 * @uses bp_current_author_ip() To get current user IP address 55 * @uses bp_current_author_ua() To get current user agent 56 56 * @uses is_super_admin() Allow super admins to bypass blacklist 57 * @uses bbp_current_author_ip() To get current user IP address58 * @uses bbp_current_author_ua() To get current user agent59 * @return bool True if test is passed, false if fail60 57 */ 61 58 function bp_core_check_for_moderation( $user_id = 0, $title = '', $content = '' ) { … … 156 153 * Checks for blocked keys 157 154 * 158 * @since bbPress (r3446)159 *160 155 * @param int $user_id Topic or reply author ID 161 156 * @param string $title The title of the content 162 157 * @param string $content The content being posted 163 * @ uses is_super_admin() Allow super admins to bypass blacklist158 * @return bool True if test is passed, false if fail 164 159 * @uses bp_current_author_ip() To get current user IP address 165 160 * @uses bp_current_author_ua() To get current user agent 166 * @return bool True if test is passed, false if fail 161 * @uses is_super_admin() Allow super admins to bypass blacklist 162 * @since 1.6 167 163 */ 168 164 function bp_core_check_for_blacklist( $user_id = 0, $title = '', $content = '' ) { … … 222 218 if ( empty( $word ) ) { continue; } 223 219 224 // Do some escaping magic so that '#' chars in the 225 // spam words don't break things: 220 // Do some escaping magic so that '#' chars in the spam words don't break things: 226 221 $word = preg_quote( $word, '#' ); 227 222 $pattern = "#$word#i"; … … 246 241 * Get the current-user IP address 247 242 * 248 * @since BuddyPress (1.6)249 *250 243 * @return string 244 * @since 1.6 251 245 */ 252 246 function bp_core_current_user_ip() { … … 259 253 * Get the current-user user-agent 260 254 * 261 * @since BuddyPress (1.6)262 *263 255 * @return string 256 * @since 1.6 264 257 */ 265 258 function bp_core_current_user_ua() { … … 273 266 return apply_filters( 'bp_core_current_user_ua', $retval ); 274 267 } 275 276 268 ?>
Note: See TracChangeset
for help on using the changeset viewer.