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 Backslash Error #266

Merged
merged 3 commits into from
May 30, 2024
Merged

Fix Backslash Error #266

merged 3 commits into from
May 30, 2024

Conversation

Totto16
Copy link
Collaborator

@Totto16 Totto16 commented Mar 26, 2024

Fix Backslash Error

Description

libgda escapes the string on inserting it into the db. You can't change that behavior (as far as my research goes) So the easiest method to fix this, is to unescape the string on retrieval. This could escape a few things too many, but my testing resulted in no errors and the issues fixed. This could potentially also occur in other fields, not just "content", but I see no possibility to add arbitrary data in any other field and there is no escape character in the hard-coded option / choices of the other strings, or the serialized date etc.

I tested it locally, but it would be great if it would be tested by another one too, I will daily drive this for now and if I discover issues, (like swallowed characters due to unescaping) I will report it, but I think it's safe to use, since it didn't yield any errors from some manual tests with \ heavy files (latex files).

TODO:

Unescaping may fail, since there might be some wrong escape sequences in the string, so if the unescaping fails, we fallback to the escaped string, even if this should never fail, since it was escaped by libgda beforehand.

Fixes #196
Fixes #107

P.S: If this is merged, I also will file a PR to the legacy branch, to fix it in the Gnome < 45 too.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • My code follows the style guidelines of this project
  • My commits follow the commit standards of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have checked my code and corrected any misspellings

@Totto16 Totto16 marked this pull request as ready for review March 26, 2024 01:21
@Totto16 Totto16 marked this pull request as draft March 26, 2024 16:59
@Totto16 Totto16 marked this pull request as ready for review May 29, 2024 17:56
@Totto16 Totto16 self-assigned this May 29, 2024
@Totto16 Totto16 added the bug Something isn't working label May 29, 2024
…bly null / undefined "searchValue" filed

- improved typings to not have to cast them manually, that catches some bugs (and would have caught the one above)
@Totto16 Totto16 added the Priority Medium Priority Medium label May 29, 2024
@Totto16
Copy link
Collaborator Author

Totto16 commented May 29, 2024

This looks fine now, I tested it locally and it works as expected, I also fixed the error in #196 (comment) (thanks again for finding that)

(and thanks @SanderTuit for the fixes in 5f07953 and bumping me again, to make me fix this xD)

I feel confident that this works, but I'd wait for some other confirmations, until merging.

So please test this if possible ❤️

@analytic-bias @NinZeige @e2ipi-1 @EmixamPP @naiiren (just pinging you, since you have interacted in the issues, maybe you could test this ❤️ )

@Totto16 Totto16 requested a review from oae May 29, 2024 18:30
@Totto16 Totto16 merged commit 19f0d20 into oae:master May 30, 2024
1 check passed
@Totto16 Totto16 deleted the fix-backslash-escape branch May 30, 2024 20:28
Totto16 added a commit that referenced this pull request May 30, 2024
-  fix #196 and #107: by unescaping the string after reading it from the db
- this is a bug fix backport from #266
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority Medium Priority Medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Repeated backslash escape Bug with selecting text containing escape character \
3 participants