Validate geonames and TGN IDs fetched from Wikidata

This commit is contained in:
Joshua Ramon Enslin 2021-12-14 15:40:07 +01:00
parent 20f609f6d0
commit 52a90d669c
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -1102,8 +1102,8 @@ final class NodaWikidataFetcher {
$currentPlaceResult->close(); $currentPlaceResult->close();
unset($currentPlaceResult); unset($currentPlaceResult);
if (isset($data['claims']['P1566'])) $geonames_id = $data['claims']['P1566'][0]['mainsnak']['datavalue']['value']; if (isset($data['claims']['P1566'])) $geonames_id = filter_var($data['claims']['P1566'][0]['mainsnak']['datavalue']['value'], FILTER_VALIDATE_INT);
if (isset($data['claims']['P1667'])) $tgn_id = $data['claims']['P1667'][0]['mainsnak']['datavalue']['value']; if (isset($data['claims']['P1667'])) $tgn_id = filter_var($data['claims']['P1667'][0]['mainsnak']['datavalue']['value'], FILTER_VALIDATE_INT);
$nodaLinks = [ $nodaLinks = [
"wikidata" => $wikidata_id, "wikidata" => $wikidata_id,