Skip to content

Commit

Permalink
Use str_ends_with function over strpos to fix false notice (#1036)
Browse files Browse the repository at this point in the history
  • Loading branch information
pradpnayak authored Feb 15, 2025
1 parent eaee170 commit 67d2dd2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion webform_civicrm.module
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ function webform_civicrm_civicrm_buildForm($formName, $form) {
}
$elements = $webform->getElementsDecodedAndFlattened();
foreach (array_keys($elements) as $element_form_key) {
if (strpos($element_form_key, "custom_$fid") !== FALSE) {
if (str_ends_with($element_form_key, "custom_$fid") !== FALSE) {
$nodes[] = $webform->toLink()->toString();
}
}
Expand Down

0 comments on commit 67d2dd2

Please sign in to comment.