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

bugfix: text fields with "%" can be edited successfully #151

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jzwood
Copy link
Contributor

@jzwood jzwood commented May 8, 2023

Explanation of Change

This PR updates formatted query to only use interpolation via vsprintf when there are parameters present. Parameterized queries are made in a number of places in the app but, critically, not when users are updating their fields directly. This allows parameters queries to be used everywhere in the app as before without limited which characters end users can put in their text fields.

Steps to Verify

Setup:

=# CREATE TABLE test_table (
  field_a CHARACTER VARYING(255),
  field_b CHARACTER VARYING(255)
);

=# INSERT INTO test_table (field_a, field_b) VALUES (
    '<% eex template content %>',
    'normal plain text'
);

Screenshot 2023-05-08 at 1 57 17 PM

On master branch, field_a cannot be successfully updated b/c vsprintf thinks the % is part of string interpolation (note: this is correct behavior for vsprintf).

Screenshot 2023-05-08 at 1 57 42 PM

Screenshot 2023-05-08 at 1 56 28 PM

On the branch for this PR, the above fields can be updated without 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.

1 participant