torstenroeder / zefiro

Small Content Management Framework in PHP/MySQL
GNU Lesser General Public License v3.0
0 stars 1 forks source link

How to: HTML escape? #21

Open Rillke opened 5 years ago

Rillke commented 5 years ago

Does the CMS provide a function to HTML-escape a string?

E.g. > --> >

How would you display results from database queries?

torstenroeder commented 5 years ago

I think there is no general solution for this. Is ">" is a literal string stored in a text field in the database? In some cases this could be part of a HTML element, in other cases it could be a literal "greater than". It is crucial to check how data is represented (or how it is intended) in the text field.