PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.14
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.14
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
← All changes | app/Modules/Registerer/Menu.php +15 -2 6.2.56.2.14 View file →
@@ -933,9 +933,15 @@
933 933 $formField,
934 934 $form
935 935 );
936 936
937 - if (!$formFields['fields'][$index]) {
937 + // Shape check, not truthiness: a listener that returns false
938 + // to remove an element can be handed to a LATER listener on
939 + // the same hook, whose `$item['settings'][...] = ...` makes
940 + // PHP auto-vivify false into a truthy, element-less array.
941 + // A plain falsy test would then keep that malformed stub and
942 + // read $formField['element'] off it a few lines below.
943 + if (!is_array($formField) || !isset($formField['element'])) {
938 944 unset($formFields['fields'][$index]);
939 945 continue;
940 946 }
941 947
@@ -959,12 +965,19 @@
959 965 $columnField,
960 966 $form
961 967 );
962 968
963 - if (!$columns[$columnIndex]['fields'][$fieldIndex]) {
969 + $columnField = $columns[$columnIndex]['fields'][$fieldIndex];
970 +
971 + if (!is_array($columnField) || !isset($columnField['element'])) {
964 972 unset($columns[$columnIndex]['fields'][$fieldIndex]);
965 973 }
966 974 }
975 +
976 + // Reindex after any removal: array_values() below only
977 + // reindexes the COLUMNS, so a gap left here would encode
978 + // as a JSON object and the editor iterates a list.
979 + $columns[$columnIndex]['fields'] = array_values($columns[$columnIndex]['fields']);
967 980 }
968 981
969 982 $formFields['fields'][$index]['columns'] = array_values($columns);
970 983 }