Note that there are some explanatory texts on larger screens.

plurals
  1. POIs jQuery .text() method XSS safe?
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COEven though jQuery effectively escapes HTML elements when using `.text(data)`, something can be said for not having completely unescaped user defined HTML in your database at all. You should not have to trust your memory to use client side HTML escaping every time you use that database variable and neither should anyone ever using your code. So I'd say, strip the html tags from the data before saving it to your database. Have some tests that ensure you can only save html stripped data for user defined fields. I don't really see the value of escaping vs. stripping in this case.
      singulars
    2. COIf user wants send html I don't want say to him sorry bro you can't. Maybe that is not html how should i know? whats wrong with saving in database not sanitized data? Why should I delete some parts or modify user data? If I do then how user will be able get his data exactly he submitted?
      singulars
    3. COIt's not about refusing to store dangerous data, it's about making dangerous data safe to store and use. Not many people will try to legitimately use HTML and those who do will see that their HTML is stripped soon enough. Stripping the html tags around text will still leave the text inside them. You really have to modify user data that if that data can be dangerous to you and others. Don't leave it around in your database to be used accidentally.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload