Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

当url请求地址,带有编码的字符串,并且编码字符串中包含?时,框架会报错 #2190

Closed
cssherlock opened this issue Feb 27, 2020 · 0 comments · May be fixed by #2657

Comments

@cssherlock
Copy link

当url请求地址,带有编码的字符串,并且编码字符串中包含?时,框架会报错

比如, 请求地址为https://xx-xtest.xxx.com/index/index/test2/qianduanaddr/https%3A%2F%2Fxx.xxx.com%2Fh5%2Fxmbd%2F%23%2F%3Fprizeshow%3D1?code=043FhxUj0TbxGs1njkTj0EnhUj0FhxUX
时, 框架底层直接报错
报错原因,为, think\route\Rule.php这个文件 第971行报错, 原因是解析这个url时,检查这个地址有?,就会执行$info = parse_url($url); 然后直接执行 parse_str($info['query'], $var); 但是这种url地址通过parse_url解析出来, 并没有 query字段, 所有需要在调用 parse_str($info['query'], $var) 之前加一个判断
希望能修复

@big-dream big-dream linked a pull request Mar 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants