Double and single quotes problem

Hello,

onClick="dow_pdf('128', '2022-12-29-11-44','<?php echo $file_title; ?>')

The button is not clickable when the file title has single or double quotes in the text.
What needs to be done to avoid that single and double quotes or any other character will affect the button click?

I looked on the internet but I didn’t understand anything.

Any dynamic value that you output in a html context should have htmlentities(), with the ENT_QUOTES flag, applied to it so that any html entities in the value won’t break the markup of the html document.

Thank you for the answer
Single quotes did not fix the problem, but double quotes did
But another problem came up, it doesn’t save file in double quotes
The best way would be to regenerate the filename with the find replace function.

Sponsor our Newsletter | Privacy Policy | Terms of Service