GravityPDF / gravity-pdf

Gravity PDF is a GPLv2-licensed WordPress plugin that allows you to automatically generate, email and download PDF documents using Gravity Forms.
https://gravitypdf.com
88 stars 21 forks source link

PDF Settings: Text Inputs do not save % character #1482

Closed dantabifranca closed 7 months ago

dantabifranca commented 10 months ago

Description An issue where a label in the PDF settings that includes a percent % sign written before a number, such as "%10", is being removed in the PDF settings after updating them, as well as in the final PDF output.

Step To Reproduce Steps to reproduce the behavior:

  1. Use an Invoice template and change the Default Tax Name to “%10 GST
  2. Add/update PDF settings.
  3. View the Invoice PDF and check that “%10” is not displayed.
  4. Go back to the PDF settings and check that the “%10” is removed from the Default Tax Name.

Expected behavior The “%10” text is removed from both the PDF output, and the Default Tax Name in the PDF settings.

Screen Recording

https://github.com/GravityPDF/gravity-pdf/assets/70549540/8a4acda7-194a-4872-a719-f713a60fd02a

jakejackson1 commented 7 months ago

Determined this bug is caused by the sanitize_text_fields() function, which strips out text that could be considered percentage-encoded characters, such as %10. This is a security measure, so we won't be modifying this behaviour.