shopex用户登陆错误提示在nginx下乱码问题

时间:2021-11-01 20:55:48

http://www.test.cn/passport-aHR0cDosLHd3dy54eTAwNy5jbixwYXNzcG9ydC1hSFIwY0Rvc0xIZDNkeTU0ZVRBd055NWpiaXh3WVhOemNHOXlkQzFoU0ZJd1kwUnZjMHhJWkROa2VUVTBaVlJCZDA1NU5XcGlhWGRfTFRVMVUyODFiMmt6TlZwRFRqVnZhVmMxWVY5SE5UWkRRalZ3ZVVvMlMxOTJOemQ1VFRaTFh6TTJXV1ZPTlhCaGR6Wk1ObFExV1Zkc0xXeHZaMmx1TG1oMGJXd34tNTVTbzVvaTM1WkNONW9pVzVhX0c1NkNCNXB5SjZLX3Y3N3lNNktfMzZZZU41cGF3Nkw2VDVZV2wtbG9naW4uaHRtbA==-55So5oi35ZCN5oiW5a+G56CB5pyJ6K+v77yM6K+36YeN5paw6L6T5YWl-login.html

nginx服务器通过get获取url参数时,会将其中的+自动转义成%2b.导致base64_encode的文字,解密后乱码。解决办法,再换回来了。

function login($url,$error_msg=''){
//$error_msg = urldecode( $error_msg );

$error_msg=str_replace('%2b','+',$error_msg);

$error_msg=str_replace('%2B','+',$error_msg);