在经典asp中清理输入的好方法 [英] Good way to sanitize input in classic asp

查看:22
本文介绍了在经典asp中清理输入的好方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须更新工作中的旧项目.虽然我熟悉 php 脚本,但我没有任何经典 asp 的经验.

I have to update old projects at work. I do not have any experience with classic asp, although i'm familiar with php scripting.

  • 有什么我应该使用的功能吗?
  • 能否为我提供一些基本保护的好功能?
  • 在 asp 中有没有类似参数化查询的东西?

谢谢!

推荐答案

是的,您可以在经典 ASP(更准确地说,经典 ADO)中使用参数化查询.

Yes you can use parametrized queries in classic ASP (more accurately, classic ADO).

这是一个链接.

至于编码输出,我可能想为最新的 Microsoft Anti-XSS 库创建一个包装器,并使用 Server.CreateObject 调用它.由于我在 .Net 中花费的时间更多,因此我远不是这类事情的专家,所以我认为这会起作用.

As for encoding output, I might be tempted to create a wrapper for the latest Microsoft Anti-XSS library and call it with Server.CreateObject. I am far from an expert on this kind of thing as I spend much more time in .Net, so I only think this would work.

Server.HTMLEncode 确实不够好,因为它只将一些编码字符列入黑名单.Anti-XSS 库要好得多,因为它将可接受的内容列入白名单.

Server.HTMLEncode is really not good enough, as it only blacklists a few encoding characters. The Anti-XSS library is much better as it whitelists what is acceptable.

这篇关于在经典asp中清理输入的好方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆