Changeset 10928 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-registration.php
- Timestamp:
- 04/27/2021 04:24:21 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-registration.php
r10902 r10928 1 1 <?php 2 2 3 function wporg_login_check_recapcha_status( $check_v3_action = false ) {3 function wporg_login_check_recapcha_status( $check_v3_action = false, $block_low_scores = true ) { 4 4 5 5 // reCaptcha V3 Checks … … 22 22 23 23 // Block super-low scores. 24 if ( (float)$result['score'] < (float) get_option( 'recaptcha_v3_threshold', 0.2 ) ) {24 if ( $block_low_scores && (float)$result['score'] < (float) get_option( 'recaptcha_v3_threshold', 0.2 ) ) { 25 25 return false; 26 26 } … … 122 122 } 123 123 124 $pending_user['meta']['akismet_result'] = wporg_login_check_akismet( $user_login, $user_email ); 125 126 $pending_user['cleared'] = ( 127 'spam' !== $pending_user['meta']['akismet_result'] && 128 (float)$pending_user['scores']['pending'] >= (float) get_option( 'recaptcha_v3_threshold', 0.2 ) 129 ); 130 124 131 $inserted = wporg_update_pending_user( $pending_user ); 125 132 if ( ! $inserted ) { … … 147 154 $user = wporg_get_pending_user( $user ); 148 155 149 if ( ! $user || $user['created'] ) {156 if ( ! $user || $user['created'] || ! $user['cleared'] ) { 150 157 return false; 151 158 } … … 230 237 } 231 238 239 } 240 241 function wporg_delete_pending_user( $pending_user ) { 242 global $wpdb; 243 244 if ( empty( $pending_user['pending_id'] ) ) { 245 return false; 246 } 247 248 return $wpdb->delete( 249 "{$wpdb->base_prefix}user_pending_registrations", 250 array( 'pending_id' => $pending_user['pending_id'] ) 251 ); 232 252 } 233 253
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)