Commit be57e489 authored by Thomas Löffler's avatar Thomas Löffler

Remove obsolete conditions and fix implode() call

parent 739a3099
Pipeline #7822 passed with stages
in 4 minutes and 47 seconds
......@@ -89,19 +89,13 @@ class DocumentationService implements \TYPO3\CMS\Core\SingletonInterface
$defaultVersion,
// just 2 points without v
];
$versionParts = explode('.', $string);
$versionParts = explode('.', $defaultVersion);
if (count($versionParts) === 3) {
$possibleVersionStrings[] = implode(array_slice($versionParts, 0, 2), '.');
}
if (substr($defaultVersion, 0, 1) === 'v') {
$possibleVersionStrings[] = ltrim($defaultVersion, 'v');
}
if (count($versionParts) === 3 && substr($defaultVersion, 0, 1) === 'v') {
$possibleVersionStrings[] = ltrim(implode(array_slice($versionParts, 0, 2), '.'), 'v');
$possibleVersionStrings[] = implode('.', array_slice($versionParts, 0, 2));
}
$possibleVersionStrings[] = ltrim($defaultVersion, 'v');
$possibleVersionStrings[] = ltrim(implode('.', array_slice($versionParts, 0, 2)), 'v');
return $possibleVersionStrings;
}
......
Markdown is supported
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