Changeset 9167 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-registration.php
- Timestamp:
- 10/09/2019 07:07:07 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-registration.php
r9147 r9167 1 1 <?php 2 2 3 function wporg_login_check_recapcha_status() { 3 function wporg_login_check_recapcha_status( $check_v3_action = false ) { 4 5 // reCaptcha V3 Checks 6 if ( $check_v3_action ) { 7 if ( empty( $_POST['_reCaptcha_v3_token'] ) ) { 8 return false; 9 } 10 $result = wporg_login_recaptcha_api( 11 $_POST['_reCaptcha_v3_token'], 12 RECAPTCHA_V3_PRIVKEY 13 ); 14 15 if ( 16 ! $result || 17 ! $result['success'] || 18 $check_v3_action !== $result['action'] 19 ) { 20 return false; 21 } 22 23 // Block super-low scores. 24 if ( (float)$result['score'] < (float) get_option( 'recaptcha_v3_threshold', 0.2 ) ) { 25 return false; 26 } 27 } 28 29 // reCaptcha V2 Checks 4 30 if ( empty( $_POST['g-recaptcha-response'] ) ) { 5 31 return false; … … 14 40 return false; 15 41 } 42 16 43 return (bool) $result['success']; 17 44 }
Note: See TracChangeset
for help on using the changeset viewer.