Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix search query special chars (#1605) #1660

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

anvit
Copy link
Contributor

@anvit anvit commented Sep 20, 2023

The search query used in the generateQueryString function does not escape special characters specified in the escape_queries setting, and the query provided to it by arElasticSearchPluginQuery has not been previously escaped either.

This seems to have regressed during #1518 and I can't seem to find references to escapeTerm being called elsewhere and the search query escaping user provided special characters, so I'm updating this in the generateQueryString function to call escapeTerm to escape the search query so that this setting is respected.

If there's a better place to make this function call to pre-escape the query string, let me know.

@anvit anvit added the Type: bug A flaw in the code that causes the software to produce an incorrect or unexpected result. label Sep 20, 2023
@anvit anvit added this to the 2.8.0 milestone Sep 20, 2023
@anvit anvit requested a review from a team September 20, 2023 18:58
@anvit anvit self-assigned this Sep 20, 2023
@anvit anvit linked an issue Sep 20, 2023 that may be closed by this pull request
The search query used in the generateQueryString function does not
escape special characters specified in the escape_queries setting, and
the query provided to it by arElasticSearchPluginQuery has not been
previously escaped either. Updating this to call escapeTerm to escape
the search query so that this setting is respected.
@anvit anvit force-pushed the dev/issue-1605-search-special-chars branch from 9929db0 to f374ec5 Compare October 3, 2023 18:59
@anvit anvit merged commit f374ec5 into qa/2.x Oct 3, 2023
@anvit anvit deleted the dev/issue-1605-search-special-chars branch October 3, 2023 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: bug A flaw in the code that causes the software to produce an incorrect or unexpected result.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression: Escape special characters setting no longer working in 2.7.x
2 participants