Description
Hi,
Script will break when multiple subdivisions are returned from maxmind-db and this error will be logged: Expected comma or array end but found T_OBJ_BEGIN at character 980
Tested with this ip: 194.187.249.181 (France)
Script will try to return invalid constructed json that could not be parsed later on:
"subdivisions": [{
"geoname_id": 11071623,
"iso_code": "OCC",
"names": {
"en": "Occitanie",
"fr": "Occitanie"
}
} {
"geoname_id": 3036965,
"iso_code": "09",
"names": {
"de": "Ariège",
"en": "Ariège",
"es": "Arieja",
"fr": "Ariège"
}
}]
Comma is missing between these two objects.
I've personally solved it modifying the _dump_entry_data_list function where array is handled adding additional condition:
if size>0 then
table.insert(resultTab, ",");
end
Here is a print screen:
https://www.dropbox.com/s/u1jwuj03nkmzcbm/Screenshot%202018-07-11%2013.22.44.png?dl=0
Hope this helps,
Thanks