actionscript-3 - 替换第三方 Actionscript Flash 文件中的单词
问题描述
先生,我说的是一个聊天网站的Flash皮肤,在那个皮肤中有一个用户列表,我想将“”的任何文本替换src
为一个单词“ attacker
”,这样它就不会被html执行。
如需进一步的建议,我应该提供整个videochat.fla的代码还是仅在videochat.fla中提供userlist.as的代码?
这是userlist.as的代码:https ://pastebin.com/vVifkVZ5
下面是我正在谈论的聊天用户列表的图像,如果任何用户更新显示在User
列表中用户名前面的状态消息,则该单词src
应自动替换为attacker
。
解决方案
快速查看您的代码,似乎function onJoin()
有用于添加到用户列表的用户名。也许尝试在那时编辑名称?
public function onJoin(result:Object)
{
//* result values:
//* result["username"]
//* result["room"]
//* result["profile"]
//# edit the user-name
if ( result["username"].indexOf("src") >= 0 )
{
result["username"] = result["username"].replace("src", "attacker");
}
//# do rest of code
if (!user_exists(result["username"]))
{
addUser(result["username"],result["profile"]);
}
else
{
changeUser(result["username"],result["profile"]);
}
if (result["profile"]["invisible"] != true )
{
this["memberlist"].onJoin(result["username"]);
}
loadWidgets();
}
}
推荐阅读
- python - 使用多项式内核提高 SVM 的速度
- antd - 如何修复 ant.design 中的“PageHeader”错误
- ruby-on-rails - 如何使用 Neo4j.rb 转储数据
- android - 一个片段到另一个片段的事务问题
- arduino-uno - 如何检查是否满足多个条件
- java - 签署 HmacSHA256 - 算法无关吗?
- python - 如何访问 Django 模型字段值?
- php - CAKE PHP 3.6 setViewVars 未将变量传递给电子邮件模板
- android - android 应用程序生成的密钥哈希之间的差异
- c# - 使用链表从具有 x 和 y 坐标的点形成三角形