Changeset 13164 for trunk/src/bp-core/admin/bp-core-admin-functions.php
- Timestamp:
- 12/10/2021 01:29:52 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/admin/bp-core-admin-functions.php
r13137 r13164 1417 1417 } 1418 1418 1419 if ( empty( $_POST['nonce'] ) || empty( $_POST['notice_id'] ) ) { 1419 $nonce_data = array(); 1420 if ( isset( $_SERVER['HTTP_X_BP_NONCE'] ) ) { 1421 $nonce_data = array( 1422 'nonce' => $_SERVER['HTTP_X_BP_NONCE'], 1423 'action' => 'bp_dismiss_admin_notice', 1424 ); 1425 } elseif ( isset( $_POST['nonce'] ) ) { 1426 $nonce_data['nonce'] = $_POST['nonce']; 1427 } 1428 1429 if ( empty( $nonce_data['nonce'] ) || empty( $_POST['notice_id'] ) ) { 1420 1430 wp_send_json_error(); 1421 1431 } 1422 1432 1423 1433 $notice_id = wp_unslash( $_POST['notice_id'] ); 1424 1425 if ( ! wp_verify_nonce( $_POST['nonce'], 'bp-dismissible-notice-' . $notice_id ) ) { 1434 if ( ! isset( $nonce_data['action'] ) ) { 1435 $nonce_data['action'] = 'bp-dismissible-notice-' . $notice_id; 1436 } 1437 1438 if ( ! wp_verify_nonce( $nonce_data['nonce'], $nonce_data['action'] ) ) { 1426 1439 wp_send_json_error(); 1427 1440 } 1428 1441 1429 bp_update_option( "bp-dismissed-notice- $notice_id", 1);1442 bp_update_option( "bp-dismissed-notice-{$notice_id}", true ); 1430 1443 1431 1444 wp_send_json_success();
Note: See TracChangeset
for help on using the changeset viewer.