Skip to content

feat(filter_by): add helper to escape filter string values#115

Merged
tharropoulos merged 1 commit intotypesense:masterfrom
eyupcanakman:feat/filter-by-escape-helper-49
Mar 5, 2026
Merged

feat(filter_by): add helper to escape filter string values#115
tharropoulos merged 1 commit intotypesense:masterfrom
eyupcanakman:feat/filter-by-escape-helper-49

Conversation

@eyupcanakman
Copy link
Contributor

Change Summary

Fixes #49 by adding a helper for safely building filter_by string values.

  • add Typesense\FilterBy::escapeString(string $value): string
  • wrap values in backticks and escape embedded backticks
  • add feature tests for special characters (&&, ||, quotes, brackets, commas, newlines) and multiple embedded backticks
  • add a README usage section for escaping filter_by values

PR Checklist

@tharropoulos tharropoulos merged commit d16028d into typesense:master Mar 5, 2026
1 check passed
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.

Add a helper function to escape filters correctly

2 participants