Wysiwyg 和嵌入视频 - 是否有 PHP 过滤类
我想让我的“不受信任”的用户使用所见即所得加在他们的帖子中嵌入视频(至少来自 YouTube)。是否有通用的 PHP 类来过滤输出以防止 xss?
I want to let my 'untrusted' users to use wysiwyg plus to embed videos (at least from YouTube) in their posts. Is there a universal PHP class to filter outputs to protect from xss?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个问题不应该仅仅局限于添加 YouTube 链接时防止 XSS,其他内容呢?有几个选项可用于处理用户可能输入的内容的输出,请参阅:
清理
和
AntiSamy
The issue should not only be limited to preventing XSS when adding a YouTube link, what about the rest of the content? There are a couple of options for handling the output of what users may enter, see:
Sanitize
and
AntiSamy
没有。最好的选择是创建一个新按钮来嵌入视频。如果不使用某种 bb 代码,就放弃 wysiwyg plus。或者接受XSS的可能性。
Nope. Your best bet is to create a new button for embedding the video. And ditching wysiwyg plus if it doesn't use some kind of bb code. Or accept the possibility of XSS.