开发者

prevent browser from evaluating %2F

I have a php script which generates a bunch of links like so

<a href="http://localhost/explorer/index.php?repository_id=default&folder=%2Fmypath%2Finner%2Finner2">link</a>

but when I hover over this link or click on it, it really goes to http://localhost/explorer/index.php?repository_id=default&folder=/mypath/inner/inner2

How do I prevent this behavior and force it to go to http://localhost/explorer/index.php?repository_id=default&folder=%2Fmypath%2Finner%2Finner2 The tool which receives this input needs to have %2F inside of the 开发者_运维问答/


The hover display is often unescaped for ease of use. If you inspect the page source it should still be uri escaped.

When you use the link the GET param will still be uri escaped and get to your php script intact.


You need to encode the URL string you are using. http://php.net/manual/en/function.urlencode.php

Or manually Replace %2 with %252F (% encoded + 2F)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜