Answer the question
In order to leave comments, you need to log in
Why are html entities not converted via html_entity_decode?
Guys, hello!
Please help! Very much! Killed all day, I can not understand what kind of garbage this is.
The crux of the problem!
I store the autoresponder hidden fields in the database so that I can use them later. When the form is submitted, these hidden autoresponder fields are run through htmlentities to sanitize the code, then written to the database. - Everything is good here! The recording passes, the transformation too.
BUT! When decoding HTML entities are not converted, I use the function - html_entity_decode.
I have the ability to preview the file in which this data will be written - the problem is that these hidden fields are displayed as plain text - this is what I get in the source code
"<input type='hidden' name='removed_header' value=''><input type='hidden' name='element_privacy' value=''><input type='hidden' name='uid' value='536934'><input type='hidden' name='tid' value='0'><input type='hidden' name='lang' value='ru'><input type='hidden' name='did[]' value='754326'><input type='hidden' name='script_url_1_13' value='https://imgs.smartresponder.ru/on/dc47aab649ed2857667697cf94fb8cd110e6f38f/1_13'>"
<input type='hidden' name='removed_header' value=''><input type='hidden' name='element_privacy' value=''><input type='hidden' name='uid' value='536934'><input type='hidden' name='tid' value='0'><input type='hidden' name='lang' value='ru'><input type='hidden' name='did[]' value='754326'><input type='hidden' name='script_url_1_13' value='https://imgs.smartresponder.ru/on/dc47aab649ed2857667697cf94fb8cd110e6f38f/1_13'>
Answer the question
In order to leave comments, you need to log in
And why do you need to encode them when writing to the database, why neutralize the code for writing to the database?
You need to neutralize it when inserting it into the page code, and you can insert at least a bald trait into the database - in my opinion today there are no more DBALs that will not escape the data. And your question, as far as I understand, refers specifically to escape.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question