Database for Content - OK to store HTML?

后端 未结 5 1194
失恋的感觉
失恋的感觉 2021-01-04 03:24

Basic question is - is it safe to store HTML in a database if I restrict who can submit to it?

I have a pretty simple question. I provide video tutorials and other

5条回答
  •  醉话见心
    2021-01-04 03:42

    From the security point of view it is not less secure to store your HTML in a database than storing it anywhere else - if you are the only author of that HTML. But then again if other people can author HTML in your website then it doesn't matter where you store it - only how you sanitize it and how and where you display it.

    Now whether or not it is an efficient way to store HTML is a completely different matter. If I were you I would use some decent templating system and store HTML in files.

提交回复
热议问题