Skip to content

Issue when field value contains a single quote #14

New issue

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

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

Already on GitHub? # to your account

Open
uandco opened this issue May 30, 2022 · 1 comment
Open

Issue when field value contains a single quote #14

uandco opened this issue May 30, 2022 · 1 comment

Comments

@uandco
Copy link

uandco commented May 30, 2022

This code fails when the input value contains a single quote as the value is not escaped prior to being wrapped with single quotes, in form-panel-custom.vue:

                for (let i = 0; i < vars.length; i++) {
                    if(condition.includes(vars[i].field)) {
                        condition = condition.replace(vars[i].field, `'${vars[i].value}'`)
                    }
                }

Proposed fix:

                for (let i = 0; i < vars.length; i++) {
                    if(condition.includes(vars[i].field)) {
                        condition = condition.replace(vars[i].field, `'${(vars[i].value).replaceAll("'", "\\'")}'`)
                    }
                }
@uandco
Copy link
Author

uandco commented Jul 5, 2023

Any update on this or is the package abandoned and safe to be locally forked so I can fix it without being impacted by updates?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant