diff --git a/module/VuFind/src/VuFind/Connection/Wikipedia.php b/module/VuFind/src/VuFind/Connection/Wikipedia.php index b532cfaf3b4049d318fd4fc352fa463e56edbe48..c8b55e04ea1c637c4d4e1553b381362a6679a4af 100644 --- a/module/VuFind/src/VuFind/Connection/Wikipedia.php +++ b/module/VuFind/src/VuFind/Connection/Wikipedia.php @@ -361,11 +361,16 @@ class Wikipedia implements TranslatorAwareInterface $page = array_shift($page['revisions']); // Check for redirection $as_lines = explode("\n", $page['*']); - if (stristr($as_lines[0], '#REDIRECT')) { - preg_match('/\[\[(.*)\]\]/', $as_lines[0], $matches); - $redirectTo = $matches[1]; - } else { - $redirectTo = false; + $redirectTo = false; + $redirectTokens = ['#REDIRECT', '#WEITERLEITUNG', '#OMDIRIGERING']; + foreach ($redirectTokens as $redirectToken) { + if (stristr($as_lines[0], $redirectToken)) { + preg_match('/\[\[(.*)\]\]/', $as_lines[0], $matches); + $redirectTo = $matches[1]; + break; + } + } + if (!$redirectTo) { break; } }