PluginProbe
JetFormBuilder — Dynamic Blocks Form Builder / 3.6.6
JetFormBuilder — Dynamic Blocks Form Builder v3.6.6
3.6.6.1 3.6.6 3.6.5.4 3.6.5.3 3.6.5.2 3.6.5.1 3.6.5 3.6.4.2 3.6.4.1 3.6.4 3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 All 134 releases
← All changes | modules/captcha/hcaptcha/hcaptcha.php +20 -6 3.6.2 → 3.6.6 View file →
@@ -27,8 +27,9 @@
27 27 public function verify( array $request ) {
28 28 $action = ( new Verify_Token_Action() )
29 29 ->set_secret( $this->options['secret'] ?? '' )
30 30 ->set_token( $request[ self::FIELD ] ?? '' )
31 + ->set_site_key( $this->get_captcha_args()['sitekey'] )
31 32 ->set_action( jet_fb_live()->form_id );
32 33
33 34 try {
34 35 $action->send_request();
@@ -44,14 +45,9 @@
44 45 /**
45 46 * @return string
46 47 */
47 48 public function render(): string {
48 - $captcha_args = apply_filters(
49 - 'jet-form-builder/h-captcha/options',
50 - array(
51 - 'sitekey' => $this->options['key'] ?? '',
52 - )
53 - );
49 + $captcha_args = $this->get_captcha_args();
54 50
55 51 if ( empty( $captcha_args['sitekey'] ) ) {
56 52 return '';
57 53 }
@@ -72,8 +68,26 @@
72 68 </div>',
73 69 self::FIELD_CLASS,
74 70 self::FIELD
75 71 );
72 + }
73 +
74 + private function get_captcha_args(): array {
75 + $captcha_args = apply_filters(
76 + 'jet-form-builder/h-captcha/options',
77 + array(
78 + 'sitekey' => $this->options['key'] ?? '',
79 + )
80 + );
81 +
82 + if ( ! is_array( $captcha_args ) ) {
83 + $captcha_args = array();
84 + }
85 +
86 + $site_key = $captcha_args['sitekey'] ?? '';
87 + $captcha_args['sitekey'] = is_scalar( $site_key ) ? sanitize_text_field( (string) $site_key ) : '';
88 +
89 + return $captcha_args;
76 90 }
77 91
78 92 public function on_save_options( array $post_request ): array {
79 93 // phpcs:disable WordPress.Security.NonceVerification.Missing