Skip to content

fix(490): Add question mark to escaped chars in TokenEscaper#519

Open
shchepinova wants to merge 2 commits intoredis:mainfrom
shchepinova:fix/490-token-escaper-characters
Open

fix(490): Add question mark to escaped chars in TokenEscaper#519
shchepinova wants to merge 2 commits intoredis:mainfrom
shchepinova:fix/490-token-escaper-characters

Conversation

@shchepinova
Copy link

@shchepinova shchepinova commented Feb 27, 2026

This PR adds question mark ? to the escape characters in TokenEscaper.

The "Expand TokenEscaper to escape ? and | characters" issue also mentions adding the pipe character |, but this will cause TestMultiPrefixTextQuery.test_text_query_returns_both_prefixes, which uses the pipe character as a logical OR in its text search, to fail.


Note

Low Risk
Low risk: small change to query-escaping behavior plus test updates; main impact is that literal ? will now be escaped unless wildcards are being preserved.

Overview
TokenEscaper now treats ? as a character that must be escaped in RediSearch query strings, and updates the referenced Redis docs link.

Unit tests are updated to assert ? is escaped in both general text and tag-like inputs, replacing prior TODO/expected-failure cases.

Written by Cursor Bugbot for commit fa0316f. This will update automatically on new commits. Configure here.

@jit-ci
Copy link

jit-ci bot commented Feb 27, 2026

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@vishal-bala vishal-bala added the auto:minor Increment the minor version when merged label Mar 2, 2026
@shchepinova shchepinova requested a review from vishal-bala March 4, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto:minor Increment the minor version when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants