File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -366,7 +366,7 @@ public function set_captcha( $has_captcha ) {
366366 /**
367367 * Set captcha provider.
368368 *
369- * @param string $provider Provider slug.
369+ * @param mixed $provider Provider slug, as received from the form options payload .
370370 * @return Form_Settings_Data
371371 * @since 3.1.12
372372 */
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class Form_Captcha_Block {
1818 * This method will pe passed to the render_callback parameter and it will output
1919 * the server side output of the block.
2020 *
21- * @param array $attributes Block attrs.
21+ * @param array<string, mixed> $attributes Block attrs.
2222 * @return mixed|string
2323 */
2424 public function render ( $ attributes ) {
Original file line number Diff line number Diff line change @@ -988,12 +988,12 @@ public function check_form_captcha( $form_data ) {
988988 )
989989 );
990990
991- if ( is_wp_error ( $ resp ) || ! isset ( $ resp [ ' body ' ] ) ) {
991+ if ( is_wp_error ( $ resp ) ) {
992992 $ form_data ->set_error ( Form_Data_Response::ERROR_INVALID_CAPTCHA_TOKEN );
993993 return $ form_data ;
994994 }
995995
996- $ result = json_decode ( $ resp[ ' body ' ] , true );
996+ $ result = json_decode ( wp_remote_retrieve_body ( $ resp ) , true );
997997
998998 if ( ! is_array ( $ result ) || empty ( $ result ['success ' ] ) ) {
999999 $ form_data ->set_error ( Form_Data_Response::ERROR_INVALID_CAPTCHA_TOKEN );
Original file line number Diff line number Diff line change @@ -3,9 +3,9 @@ import { addCaptchaOnPage } from '../../frontend/form/captcha';
33/**
44 * Build a form container like the saved Form block markup.
55 *
6- * @param {string } id The form id.
7- * @param {Object } options Options.
8- * @param {boolean } options.legacy Add the legacy `has-captcha` class.
6+ * @param {string } id The form id.
7+ * @param {Object } options Options.
8+ * @param {boolean } options.legacy Add the legacy `has-captcha` class.
99 * @param {string } options.provider Add a Captcha block container with the given provider.
1010 * @return {HTMLDivElement } The form node, attached to the document.
1111 */
You can’t perform that action at this time.
0 commit comments