Fix bug in time splitter, make code more explicit
This commit is contained in:
@ -1094,7 +1094,7 @@ final class NodaWikidataFetcher {
|
||||
|
||||
$datafromwiki = MD_STD::runCurl("https://" . urlencode($sprache) . ".wikipedia.org/w/api.php?action=parse&page=" . urlencode($wikilinkterm[$sprache]) . "&prop=text§ion=0&format=json", 10000);
|
||||
$datafromwiki = json_decode($datafromwiki, true)['parse']['text']['*'];
|
||||
if (!empty($datafromwiki) and $datafromwiki = self::_cleanWikidataInput((string)$datafromwiki)) {
|
||||
if (!empty($datafromwiki) and !empty($datafromwiki = self::_cleanWikidataInput((string)$datafromwiki))) {
|
||||
$alreadyEntered = $this->enterPlaceDescFromWikidata($currentPlaceResult, $datafromwiki, $wikilink, $lang, $sprache, $onum, $erfasst_von);
|
||||
}
|
||||
|
||||
@ -1729,7 +1729,7 @@ final class NodaWikidataFetcher {
|
||||
$birth_date_int = strtotime(substr($inputTime, 1, 4));
|
||||
if ($birth_date_int) {
|
||||
$birth_date = date("Y", $birth_date_int);
|
||||
if ($birth_date === date("Y") and $tTime = strtotime($inputTime)) {
|
||||
if ($birth_date === date("Y") and ($tTime = strtotime($inputTime)) !== false) {
|
||||
$birth_date = date("Y", $tTime);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user