Fix bug in time splitter, make code more explicit
This commit is contained in:
parent
109f18e63c
commit
9132745631
|
@ -1016,7 +1016,7 @@ final class NodaTimeSplitter {
|
|||
|
||||
// Skip 1200-1300
|
||||
if (!empty(self::attempt_splitting($datum))) return [];
|
||||
if (strlen($datum) === 9 and substr($datum, 4, 1)) return [];
|
||||
if (strlen($datum) === 9 and substr($datum, 4, 1) !== '-') return [];
|
||||
|
||||
if (empty($startEnd = self::check_is_timespan_from_till($datum))) {
|
||||
return [];
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user