PHP to clean-up pasted Microsoft input

前端 未结 4 1936
无人共我
无人共我 2020-11-29 11:43

I have a site where users can post stuff (as in forums, comments, etc) using a customised implementation of TinyMCE. A lot of them like to copy & paste from Word, which

4条回答
  •  佛祖请我去吃肉
    2020-11-29 12:16

    HTML Purifier will create standards compliant markup and filter out many possible attacks (such as XSS).

    For faster cleanups that don't require XSS filtering, I use the PECL extension Tidy which is a binding for the Tidy HTML utility.

    If those don't help you, I suggest you switch to FCKEditor which has this feature built-in.

提交回复
热议问题