How and where can XSS protection be applied in Laravel?

前端 未结 6 1960
孤城傲影
孤城傲影 2020-12-14 19:08

I wonder how (if anyhow) is XSS protection provided in Laravel. I couldn\'t find anything about it in the documentation.

Problem

I am using

6条回答
  •  执笔经年
    2020-12-14 19:48

    As far as I know, the "official" Laravel position is that XSS prevention best practice is to escape output. Thus, {{{ }}}.

    You can supplement output escaping through input sanitation with Input::all(), strip_tags(), and array_map():

    $input = array_map('strip_tags', \Input::all());
    

提交回复
热议问题