Closed weitblick closed 21 hours ago
Thanks for the contribution. Can you provide information on how you called getResources to trigger the error and details on the error being produced?
I generated the error via an unclean &tvFilters=`` (|| at the end). I suspect that this was also the case with the other errors from https://github.com/opengeek/getResources/issues/111
[[getResources?
...
&limit=`1`
&includeTVs=`1`
&processTVs=`1`
&sortby=`{"publishedon":"DESC"}`
&tvFilters=`tagVisibleTV==%1%,tagMainTV==%Kloster%||`
&where=`{"template:=":5}`
]]
The error occurs because the strpos() function in the PHP script tries to search for a string in another string, but the start offset (argument #3, $offset) is not within the search string (argument #1, $haystack). If the offset is greater than the length of the string or is negative, PHP throws a ValueError since version 8.0.
fix php 8 error if $filter <= 1