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

quotes are escaped in field [name] of [glpi_plugin_formcreator_formanswers] #3271

Closed
MLOcc opened this issue May 4, 2023 · 1 comment
Closed
Milestone

Comments

@MLOcc
Copy link
Contributor

MLOcc commented May 4, 2023

Hi,
The name of the form having quotes is stored with backslashes in field 'name' of 'glpi_plugin_formcreator_formanswers'

image
image

To Reproduce

  1. Set a form with quote in his name
  2. Answer the form
  3. Look entry created in 'glpi_plugin_formcreator_formanswers'
  • GLPI version 10.0.6
  • FormCreataor 2..13.5

I solve the problem by replacing
$input['name'] = $DB->escape($this->parseTags($form->fields['formanswer_name']));
by
$input['name'] = $this->parseTags($form->fields['formanswer_name']);
on line 831 of /inc/formanswer.class.php (prepareInputForAdd function)

btry added a commit that referenced this issue May 5, 2023
when a formanswer name contains a single quote, it is escaped twice

fix #3271
@btry
Copy link
Collaborator

btry commented May 5, 2023

Hi

Thank you for your contribution. I validated your change and pushed the following commit e518b7d.

@btry btry closed this as completed May 5, 2023
@btry btry added this to the 2.13.6 milestone May 5, 2023
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

No branches or pull requests

2 participants