htmlpurifier remove inline css

前端 未结 1 1346
鱼传尺愫
鱼传尺愫 2021-02-20 13:40

I am using htmlpurifier to clean up user content. I am trying to remove inline style attributes like

some text
1条回答
  •  时光说笑
    2021-02-20 14:05

    You can tweak the AllowedProperties configuration by passing it an array of valid css attributes that should not be removed (white-list approach).

    However, the following should remove all css attributes

    $config->set('CSS.AllowedProperties', array());
    

    See this online demo of purifying your input html

    0 讨论(0)
提交回复
热议问题