FluidTYPO3 / vhs

TYPO3 extension VHS: Fluid ViewHelpers
https://fluidtypo3.org
Other
190 stars 229 forks source link

BUG: missing int cast #1909

Open simonschaufi opened 1 week ago

simonschaufi commented 1 week ago

I have checked that the bug exists in the dev-development branch Yes

I have checked that there are no already open issues or recently closed issues about this bug Yes

Describe the bug Missing int cast to compare uid with a potential string: https://github.com/FluidTYPO3/vhs/blob/development/Classes/ViewHelpers/Condition/Iterator/ContainsViewHelper.php#L132

To Reproduce Steps to reproduce the behavior:

have this in a news template (needle is a string here!):

<v:condition.iterator.contains needle="{overwriteDemand.categories}" haystack="{newsItem.categories}">
    <f:then>yes</f:then>
    <f:else>no</f:else>
</v:condition.iterator.contains>

Expected behavior output yes but always no.

cast to needle to int as uid is always an int but needle can be a string as well (coming from fluid template)