Wysiwyg 和嵌入视频 - 是否有 PHP 过滤类

发布于 2024-10-05 00:13:32 字数 80 浏览 0 评论 0原文

我想让我的“不受信任”的用户使用所见即所得加在他们的帖子中嵌入视频(至少来自 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

暮凉 2024-10-12 00:13:32

这个问题不应该仅仅局限于添加 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

天荒地未老 2024-10-12 00:13:32

没有。最好的选择是创建一个新按钮来嵌入视频。如果不使用某种 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文