Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions includes/Rest/Forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,11 @@
return false;
}

// 2. Check user has appropriate weMail role-based capabilities
if ( ! function_exists( 'wemail' ) || ! method_exists( wemail(), 'user' ) ) {
return false;
}

if ( ! wemail()->user->can( 'manage_form' ) ) {
return false;
}

// 3. Require nonce verification for CSRF protection
// 2. Require nonce verification for CSRF protection
$nonce = $request->get_header( 'X-WP-Nonce' );
if ( ! $nonce || ! wp_verify_nonce( $nonce, 'wp_rest' ) ) {
return false;
Expand Down Expand Up @@ -272,7 +267,7 @@
*
* @return WP_REST_Response
*/
public function sync( $request ) {

Check warning on line 270 in includes/Rest/Forms.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

The method parameter $request is never used
wemail()->form->sync();

return new WP_REST_Response( array( 'success' => true ) );
Expand Down
Loading