Skip to content
Snippets Groups Projects
Commit 64ff22d2 authored by tom-dea's avatar tom-dea Committed by Demian Katz
Browse files

fixed translations of wiki redirect token.

- checked for languages en de es fr it pt ru cs sv da sl si
parent e5e265c5
No related merge requests found
...@@ -361,11 +361,16 @@ class Wikipedia implements TranslatorAwareInterface ...@@ -361,11 +361,16 @@ class Wikipedia implements TranslatorAwareInterface
$page = array_shift($page['revisions']); $page = array_shift($page['revisions']);
// Check for redirection // Check for redirection
$as_lines = explode("\n", $page['*']); $as_lines = explode("\n", $page['*']);
if (stristr($as_lines[0], '#REDIRECT')) { $redirectTo = false;
preg_match('/\[\[(.*)\]\]/', $as_lines[0], $matches); $redirectTokens = ['#REDIRECT', '#WEITERLEITUNG', '#OMDIRIGERING'];
$redirectTo = $matches[1]; foreach ($redirectTokens as $redirectToken) {
} else { if (stristr($as_lines[0], $redirectToken)) {
$redirectTo = false; preg_match('/\[\[(.*)\]\]/', $as_lines[0], $matches);
$redirectTo = $matches[1];
break;
}
}
if (!$redirectTo) {
break; break;
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment