business-decision/query-security-bundle

Symfony QuerySecurityBundle

安装数: 6,149

依赖者: 0

建议者: 0

安全性: 0

星星数: 0

分支数: 1

类型:symfony-bundle

1.0 2023-12-04 10:46 UTC

This package is not auto-updated.

Last update: 2024-09-25 09:50:26 UTC


README

工作进度:Bundle

安装

Composer require

配置

文件路径:config/packages/query_security.yaml

parameters:
  # All Fields protection
  render_response_on_exception: true # render response instead of Exception (exception in kernel.request event are not catched)
  html_escaped: true # all field are passed to strip_tags function
  denied: ['<script>','javascript', 'http', '//']  # banned word in field value
  escaped: ['redirect']  ## word removed from value

  # per query parameters configuration
  parameters:
     fieldname:
        denied: ['<script>','javascript', 'http', '//']
        
        #Can be a static method or a function set in bootstrap.php
        validator: ['callbackFunctionName']

        #can access submit field if field is array
        subfield:
            html_escaped: false

## 待办事项

[ ] 更好的配置