Home >php教程 >php手册 >给apache2.2加上mod_encoding模块後 php5.2.0 处理url出现bug

给apache2.2加上mod_encoding模块後 php5.2.0 处理url出现bug

WBOY
WBOYOriginal
2016-06-13 12:32:201136browse

这个问题是mod_encoding已经先一步处理了url ,而PHP又解了一次
例如
x.php?s=%252B%2F%2B%2F
那么$_GET['s']得到的是
+/ /
urlencode("+") = %2B
urlencode("%2B") = %252B
所以,这个url被decode了两次
第一次是
urldecode( "%252B%2F%2B%2F")    = %2B/+/
urldecode( "%2B/+/")            = +/ / 
 解决办法
修改httpd.conf 将

    EncodingEngine    on  
这一段配置移到需要的vitualHost里去,这个不能和php脚本并存。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn