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

解析非法的地址时,发生语法错误 #18

Closed
BadTudou opened this issue Jul 15, 2022 · 1 comment
Closed

解析非法的地址时,发生语法错误 #18

BadTudou opened this issue Jul 15, 2022 · 1 comment

Comments

@BadTudou
Copy link

版本:1.2.5
PHP版本: 7.4.29
Laravel版本:8.83.13

ProvinceCityArea::parseAddress('test');

出现语法错误:

Undefined offset: XXX

触发该错误的位置在:

文件:ProvinceCityArea.php
行数:355
代码:$city = PCA::where('id', $areaList[$key]->parent_id)->first();

此处的$key的值,是省级的最后一个ID,是287行中遗留的,
是当没有市的信息时,会尝试从区获取对应的市(parent_id),当区列表为空时,此时的$key是287行遗留的,因此触发语法错误

@aoxiang594
Copy link
Owner

retry

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

No branches or pull requests

2 participants