← All changes
|
includes/Frontend/Form/View/Conversational/Fields/CheckBoxField.php
+2
-2
V3.0.2
→
3.3.1
View file →
| @@ -25,9 +25,9 @@ | ||
| 25 | 25 | $checkBoxOptions = ''; |
| 26 | 26 | $bfFrontendFormIds = FrontendHelpers::$bfFrontendFormIds; |
| 27 | 27 | $contentCount = count($bfFrontendFormIds); |
| 28 | 28 | |
| 29 | - if (property_exists($field, 'opt') && count($field->opt) > 0) { | |
| 29 | + if (is_object($field) && property_exists($field, 'opt') && is_countable($field->opt) && count($field->opt) > 0) { | |
| 30 | 30 | if (isset($field->val) && false !== strpos($field->val, BITFORMS_BF_SEPARATOR)) { |
| 31 | 31 | $defaultValues = explode(BITFORMS_BF_SEPARATOR, $field->val); |
| 32 | 32 | } else { |
| 33 | 33 | $defaultValues = isset($field->val) ? explode(',', $field->val) : []; |
| @@ -98,9 +98,9 @@ | ||
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | //Other Option |
| 102 | - $optCount = property_exists($field, 'opt') ? count($field->opt) : 0; | |
| 102 | + $optCount = isset($field->opt) && is_countable($field->opt) ? count($field->opt) : 0; | |
| 103 | 103 | $otherOptLbl = !empty($field->otherOptLbl) ? $field->otherOptLbl : __('Other...', 'bit-form'); |
| 104 | 104 | $inputPh = isset($field->otherInpPh) ? "placeholder='{$fieldHelpers->esc_attr($field->otherInpPh)}'" : "placeholder='Other...'"; |
| 105 | 105 | $inpReq = isset($field->valid->otherOptReq) ? ($field->valid->otherOptReq ? 'required' : '') : ''; |
| 106 | 106 | if (property_exists($field, 'addOtherOpt') && $field->addOtherOpt) { |