Perl Escape::HTML 函数不转义#?
设法进一步缩小代码范围:
抱歉,很痛苦,但是我真的以为我已经通过在 GetQueryString
子例程中使用 uri_escape
破解了它,但现在我真的没有主意了,否则我不会问。
非常感谢任何见解。
马丁
Managed to narrow the code down a lot more:
Sorry to be a pain but I really thought I had it cracked by using uri_escape
in the GetQueryString
subroutine but now I'm really out of ideas otherwise I wouldn't ask.
Any insights are much appreciated.
Martin
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是很多的代码。减少测试用例会很有帮助。
我不会阅读所有内容,而是假设您正在做的事情:
如果是这样,那么您错过的是:
您需要对 URI 的数据进行编码。
That is a lot of code. A reduced test case would be helpful.
Rather than read all of it, I'm going to assume that this is what you are doing:
If so, then what you missed is this:
You need to encode the data for the URI.
HTML::Escape 不应该转义“#”,因为“#”对于 HTML 来说并非不安全。问题在于,在放置数据之前,您没有对数据进行 URI 转义到 URI 中;为此使用 URI::Escape 。
HTML::Escape isn't supposed to escape "#" because "#" isn't unsafe for HTML.The problem is that you're not URI-escaping your data before you're putting it into a URI; use URI::Escape for that.