Skip to content

Commit

Permalink
FIX: CS & eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Gawuww committed Nov 4, 2024
1 parent 0021ae0 commit 0effcbe
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion modules/actions-v2/call-webhook/call-webhook-action.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function do_action( array $request, Action_Handler $handler ) {
'body' => $request,
);

if ( $webhook_timeout !== false ) {
if ( false !== $webhook_timeout ) {
$args['timeout'] = $webhook_timeout;
}

Expand Down
2 changes: 1 addition & 1 deletion modules/captcha/friendly-captcha/friendly-captcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function verify( array $request ) {
$action->send_request();
} catch ( Gateway_Exception $exception ) {
throw new Spam_Exception(
Module::SPAM_EXCEPTION,
Module::SPAM_EXCEPTION, // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
$exception->getMessage(), // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
...$exception->get_additional() // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
);
Expand Down
1 change: 1 addition & 0 deletions modules/captcha/friendly-captcha/verify-token-action.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function before_make_request() {
return;
}

// phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
throw new Gateway_Exception( Module::SPAM_EXCEPTION, 'Empty solution. Spammer detected' );
}

Expand Down
2 changes: 1 addition & 1 deletion modules/captcha/hcaptcha/hcaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function verify( array $request ) {
$action->send_request();
} catch ( Gateway_Exception $exception ) {
throw new Spam_Exception(
Module::SPAM_EXCEPTION,
Module::SPAM_EXCEPTION, // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
$exception->getMessage(), // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
...$exception->get_additional() // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
);
Expand Down
1 change: 1 addition & 0 deletions modules/captcha/hcaptcha/verify-token-action.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public function send_request() {
return $response;
}

// phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
throw new Gateway_Exception( Module::SPAM_EXCEPTION );
}

Expand Down
2 changes: 1 addition & 1 deletion modules/captcha/re-captcha-v3/re-captcha-v3.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function verify( array $request ) {
$action->send_request();
} catch ( Gateway_Exception $exception ) {
throw new Spam_Exception(
Module::SPAM_EXCEPTION,
Module::SPAM_EXCEPTION, // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
$exception->getMessage(), // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
...$exception->get_additional() // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
);
Expand Down
1 change: 1 addition & 0 deletions modules/captcha/re-captcha-v3/verify-token-action.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function before_make_request() {
return;
}

// phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
throw new Gateway_Exception( Module::SPAM_EXCEPTION, 'Empty token. Spammer detected' );
}

Expand Down
2 changes: 1 addition & 1 deletion modules/captcha/turnstile/turnstile.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function verify( array $request ) {
$action->send_request();
} catch ( Gateway_Exception $exception ) {
throw new Spam_Exception(
Module::SPAM_EXCEPTION,
Module::SPAM_EXCEPTION, // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
$exception->getMessage(), // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
...$exception->get_additional() // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
);
Expand Down
1 change: 1 addition & 0 deletions modules/captcha/turnstile/verify-token-action.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public function before_make_request() {
return;
}

// phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
throw new Gateway_Exception( Module::SPAM_EXCEPTION, 'Empty solution. Spammer detected' );
}

Expand Down
1 change: 1 addition & 0 deletions modules/security/csrf/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public function handle_request( array $request ): array {
Csrf_Token_Model::clear();

if ( ! Csrf_Tools::verify( $this->token, $this->client ) ) {
// phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
throw new Spam_Exception( self::SPAM_EXCEPTION );
}

Expand Down
1 change: 1 addition & 0 deletions modules/security/honeypot/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public function handle_request( array $request ): array {
}

if ( ! empty( $request[ self::FIELD ] ) ) {
// phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
throw new Spam_Exception( self::SPAM_EXCEPTION );
}

Expand Down
1 change: 1 addition & 0 deletions modules/security/wp-nonce/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public function handle_request( array $request ): array {
$nonce = $request[ self::KEY ] ?? '';

if ( ! $this->verify( $nonce ) ) {
// phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
throw new Spam_Exception( self::SPAM_EXCEPTION );
}

Expand Down

0 comments on commit 0effcbe

Please sign in to comment.