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

Escape backslashes in parameter strings. #157

Merged
merged 1 commit into from
Jan 5, 2022

Conversation

skieffer
Copy link
Contributor

@skieffer skieffer commented Jan 4, 2022

Fixes #139

I added the functional test tests.functional.test_all.TestStringMethods.test_properties_with_escapes() which demonstrates that, when you set a property string containing backslash or quotation mark, you get the same string back after reading.

I also rewrote the unit test tests.unit.test_util.TestUtils.test_quote_string() using raw strings, which I think makes the test much easier to read and understand.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 4, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@swilly22
Copy link
Contributor

swilly22 commented Jan 5, 2022

Thank you @skieffer,
Out of curiosity what are you using RedisGraph for?

@swilly22 swilly22 merged commit d0d0c45 into RedisGraph:master Jan 5, 2022
@skieffer
Copy link
Contributor Author

skieffer commented Jan 5, 2022

Out of curiosity what are you using RedisGraph for?

It's a back end for an app that lets multiple authors share components that will be linked together -- hence the need for a graph database.

I recently added a step that stores document snippets as properties in the graph, and these snippets often have their own escaped characters within them -- including \" -- so I stumbled onto this issue.

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.

util.quote_string does not properly escape everything
2 participants