Skip to content

Commit

Permalink
fixes #2460
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Apr 17, 2019
1 parent 14fed2b commit c200a55
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* Added new `FormInterface::getTask()` method which reads the task from `form.task` in the blueprint
1. [](#bugfix)
* Rollback `redirect_default_route` logic as it has issues with multilang [#2459](https://github.com/getgrav/grav/issues/2459)
* Fixed bug in text field filtering: return empty string if value isn't a string or number
* Fix potential issue with `|contains` Twig filter on PHP 7.3
* Fixed bug in text field filtering: return empty string if value isn't a string or number [#2460](https://github.com/getgrav/grav/issues/2460)

# v1.6.5
## 04/15/2019
Expand Down
6 changes: 5 additions & 1 deletion system/src/Grav/Common/Twig/TwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,11 @@ public function chunkSplitFilter($value, $chars, $split = '-')
*/
public function containsFilter($haystack, $needle)
{
return (strpos($haystack, $needle) !== false);
if (empty($needle)) {
return $haystack;
}

return (strpos($haystack, (string) $needle) !== false);
}

/**
Expand Down

0 comments on commit c200a55

Please sign in to comment.