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

Merge branch '353-leading-zeros-in-version-numbers-break-downloads' into 'develop'

Resolve "Leading zeros in version numbers break downloads"

Closes #353

See merge request !343
parents 55569c3e f1ffe1b5
Pipeline #4554 passed with stages
in 11 minutes and 41 seconds
......@@ -157,7 +157,7 @@ class tx_ter_api
}
// check for a valid version number
if (preg_match('/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/', $extensionInfoData->version) == false) {
if (preg_match('/^(0|[1-9]\d{0,2})\.(0|[1-9]\d{0,2})\.(0|[1-9]\d{0,2})$/', $extensionInfoData->version) == false) {
throw new \T3o\Ter\Exception\Exception(
'Your version number "' . htmlspecialchars(
$extensionInfoData->version
......
......@@ -162,7 +162,8 @@ class FileProvider extends \T3o\TerFe2\Provider\AbstractProvider
}
$extension = strtolower($extension);
$fileType = strtolower(trim($fileType, '. '));
return $extension[0] . '/' . $extension[1] . '/' . $extension . '_' . $version . '.' . $fileType;
$versionNumberInFileName = implode('.', \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode('.', $version));
return $extension[0] . '/' . $extension[1] . '/' . $extension . '_' . $versionNumberInFileName . '.' . $fileType;
}
......
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