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