Skip to content

fix(laravel): ignore non-string values in search filters - #8781

Open
BenMacha wants to merge 2 commits into
api-platform:5.0from
BenMacha:fix-laravel-search-filter-array-values-5-0
Open

BenMacha wants to merge 2 commits into
api-platform:5.0from
BenMacha:fix-laravel-search-filter-array-values-5-0

Conversation

@BenMacha

@BenMacha BenMacha commented Nov 1, 2026

Copy link
Copy Markdown
Q A
Branch? 5.0
Tickets
License MIT
Doc PR

The Laravel PartialSearchFilter, StartSearchFilter and EndSearchFilter concatenate the value with %: ?name[]=a&name[]=b or ?name[x]=a raised an "Array to string conversion" ErrorException, so a 500. Non-string values are now ignored, as BooleanFilter already does.

Tests: src/Laravel/Tests/Eloquent/Filter/SearchFilterTest.php (new) and EloquentTest.

Requests such as `?name[]=a&name[]=b` or `?name[x]=a` passed an array to
PartialSearchFilter, StartSearchFilter and EndSearchFilter, which concatenated
it into the LIKE pattern and failed with "Array to string conversion" (500).
These filters now skip non-string values, like BooleanFilter does.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-01T08:06:04.317535Z
We couldn’t complete this review. Comment @codex review to try again.
ba7e90c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant