2011-06-20 81 views
1

我有一个PHP脚本生成像这样防止浏览器从评估%2F

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

但是当我将鼠标悬停在该链接或点击它,它真的去 http://localhost/explorer/index.php?repository_id=default&folder=/mypath/inner/inner2

一堆链接

如何防止这种行为,并迫使它去http://localhost/explorer/index.php?repository_id=default&folder=%2Fmypath%2Finner%2Finner2 接收此输入需要有/

回答

2

悬停显示内部%2F的工具往往是转义的易用性。如果你检查页面源,它​​应该仍然是uri转义。

当你使用链接时,GET参数仍然会被uri转义并完好地传递给你的php脚本。

+0

由于没有意识到) – user391986