Skip to content

Commit

Permalink
fix passing null value to preg_split (#507)
Browse files Browse the repository at this point in the history
  • Loading branch information
solverat authored Jan 31, 2025
1 parent 8dd3e6d commit 846e303
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- **[IMPROVEMENT]** Doctrine ORM 3.0 Support [#503](https://github.com/dachcom-digital/pimcore-formbuilder/pull/503)
- **[BUGFIX]** API Channel: Keep array index when merging child nodes [@simon-matt-oetztal](https://github.com/dachcom-digital/pimcore-formbuilder/pull/496)
- **[BUGFIX]** Update Custom Channel Documentation [#493](https://github.com/dachcom-digital/pimcore-formbuilder/issues/493)
- **[BUGFIX]** Fix passing null value to `preg_split`

## 5.1.4
- **[BUGFIX]** Allow using double-opt-in variables in placeholder processor
Expand Down
4 changes: 2 additions & 2 deletions src/OutputWorkflow/Channel/Email/Parser/MailParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ protected function extractPlaceHolder(string $str, array $fieldValues): mixed
$str = str_replace($matches[0][$key], $value, $str);
}

//remove invalid commas
$fragments = preg_split('@,@', $str, null, PREG_SPLIT_NO_EMPTY);
// remove invalid commas
$fragments = preg_split('@,@', $str, -1, PREG_SPLIT_NO_EMPTY);
$fragmentsGlued = is_array($fragments) ? implode(',', $fragments) : $fragments;
$extractedValue = is_string($fragmentsGlued) ? trim($fragmentsGlued) : $fragmentsGlued;

Expand Down

0 comments on commit 846e303

Please sign in to comment.