Add check against empty wikidata / wikipedia descriptions

This commit is contained in:
Joshua Ramon Enslin 2021-07-06 12:50:33 +02:00
parent fba4706b67
commit 0fa759c604
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -298,6 +298,7 @@ final class NodaWikidataFetcher {
// Remove infobox tables specifically
$removeFirstParagraph = false;
if (empty($input)) return "";
$firstParagraphPosition = strpos($input, '<p', 1);
$currentSearchPos = strpos($input, "<table>");
if ($currentSearchPos !== false && $currentSearchPos < $firstParagraphPosition) {