PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.7
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.7
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/models/FrmEntryValidate.php +16 -0 6.56.7 View file →
@@ -24,8 +24,9 @@
24 24 $frm_settings = FrmAppHelper::get_settings();
25 25 $errors['form'] = $frm_settings->admin_permission;
26 26 }
27 27
28 + self::maybe_fix_item_meta();
28 29 self::set_item_key( $values );
29 30
30 31 $posted_fields = self::get_fields_to_validate( $values, $exclude );
31 32
@@ -58,8 +59,23 @@
58 59 _doing_it_wrong( __FUNCTION__, 'Only arrays should be returned when using the frm_validate_entry filter.', '6.3' );
59 60 }
60 61
61 62 return $errors;
63 + }
64 +
65 + /**
66 + * In case $_POST['item_meta'] is not an array, change it to an empty array.
67 + * This helps to avoid some warnings and errors when $_POST['item_meta'] is updated.
68 + *
69 + * @since 6.6
70 + *
71 + * @return void
72 + */
73 + private static function maybe_fix_item_meta() {
74 + // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotValidated
75 + if ( ! isset( $_POST['item_meta'] ) || ! is_array( $_POST['item_meta'] ) ) {
76 + $_POST['item_meta'] = array();
77 + }
62 78 }
63 79
64 80 private static function set_item_key( &$values ) {
65 81 if ( ! isset( $values['item_key'] ) || $values['item_key'] == '' ) {