RC_Purifier 防止 XSS 跨站攻击

royalcms使用 HTMLPurifier 防止 XSS 跨站攻击。
下面列出一些常用方法:

可以使用辅助函数clean()

clean(Input::get('inputname'));

或者使用Purifier门面提供的clean方法:

RC_Purifier::clean(Input::get('inputname'));

还可以在应用中进行动态配置:

clean('This is my H1 title', 'titles');
clean('This is my H1 title', array('Attr.EnableID' => true));

或者你也可以使用Purifier门面提供的方法:

RC_Purifier::clean('This is my H1 title', 'titles');
RC_Purifier::clean('This is my H1 title', array('Attr.EnableID' => true));
这篇文章对您有用吗?