Skip to content

Commit

Permalink
Update FormHelper.php
Browse files Browse the repository at this point in the history
Prevent error if showon is malformed
  • Loading branch information
obuisard committed Sep 10, 2023
1 parent 4919c82 commit 05a331f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libraries/src/Form/FormHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,10 @@ public static function parseShowOnConditions($showOn, $formControl = null, $grou
$compareEqual = strpos($showOnPart, '!:') === false;
$showOnPartBlocks = explode(($compareEqual ? ':' : '!:'), $showOnPart, 2);

if (count($showOnPartBlocks) !== 2) {
continue;
}

$dotPos = strpos($showOnPartBlocks[0], '.');

if ($dotPos === false) {
Expand Down

0 comments on commit 05a331f

Please sign in to comment.