Skip to content

Comments

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

Open
eyupcanakman wants to merge 1 commit intotypesense:masterfrom
eyupcanakman:feat/filter-by-escape-helper-49
Open

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

Conversation

@eyupcanakman
Copy link

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

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

1 participant