-
Notifications
You must be signed in to change notification settings - Fork 174
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
[LorisForm] Fix quotation display in text elements #7490
[LorisForm] Fix quotation display in text elements #7490
Conversation
@CamilleBeau I have only given a very quick look over this but I potentially see a few issues.
|
Yes all of the special chars are in plaintext at this point, so they display fine on the front end. The problem with the quotation mark is that the value is set in quotation marks in the HTML element, so having a plaintext quotation mark in the value tricks it into thinking the value is done, and the rest of the value is not considered (e.g.
They are stored as |
Thats a huge red flag. if someone stores a value like
I think you should investigate at what point that is instead of adhoc re-encoding them at this level |
@ridz1208 Ok yes good point.. I tried looking into where they were being decoded and I'm not sure what's going on here. From what I can tell, when the page is loaded the values are stored into |
@driusan @ridz1208 PLEASE NOTE: The current changes in this PR are not meant to be the actual solution or merged, but are meant to demonstrate the problem / what is needed for a solution. Whether the values need to be encoded / decoded right now depends on whether it is from $_REQUEST or default values, and whether it is being loaded or saved. What is in the PR changes right now is a very hacky, and unadvised way of fixing this, but that has the intended functionality. A cleaner and safer solution is needed. |
closed replaced by linked PRs |
…#7776) This fixes the escaping issue that occurs when a text field in an instrument contains an HTML special character. The solution employed here is to redirect on successful save to reload data directly from the database instead of loading it using the _POST data. This solution is sub-optimal because the escaping issue will still occur when an error is detected on instrument save and the values MUST be reloaded from the _POST array where the reload can not occur to avoid losing the unsaved data. Alternate to: #7777 Fixes #7489 Replaces #7490
Brief summary of changes
This PR escape quotations in the text element HTML rendering so that the value will not get cut off, and will display properly.
Testing instructions (if applicable)
Link(s) to related issue(s)