Commit 8d3b85d1 authored by Benni Mack's avatar Benni Mack
Browse files

[BUGFIX] CGL cleanups

parent 62fe2acc
Pipeline #9139 passed with stages
in 6 minutes and 1 second
......@@ -137,19 +137,24 @@ class ExtensionVersion
if (empty($lower) || empty($upper)) {
// Either part of the range is empty
throw new FailedDependencyException('No range for TYPO3 Core given.', ResultCodes::ERROR_UPLOADEXTENSION_TYPO3DEPENDENCYINCORRECT);
} elseif (!preg_match('/^\d+\.\d+\.\d+$/', $lower) || !preg_match('/^\d+\.\d+\.\d+$/', $upper)) {
}
if (!preg_match('/^\d+\.\d+\.\d+$/', $lower) || !preg_match('/^\d+\.\d+\.\d+$/', $upper)) {
// Either part is not a full version number
throw new FailedDependencyException('No full version for TYPO3 Core given.', ResultCodes::ERROR_UPLOADEXTENSION_TYPO3DEPENDENCYINCORRECT);
} elseif (version_compare($lower, '0.0.0', '<=') || version_compare($upper, '0.0.0', '<=')) {
}
if (version_compare($lower, '0.0.0', '<=') || version_compare($upper, '0.0.0', '<=')) {
// Either part is a zero version (n < n.0 < n.0.0)
throw new FailedDependencyException('Invalid version for TYPO3 Core given.', ResultCodes::ERROR_UPLOADEXTENSION_TYPO3DEPENDENCYINCORRECT);
} elseif (version_compare($upper, $oldestSupportedCoreVersion, '<')) {
}
if (version_compare($upper, $oldestSupportedCoreVersion, '<')) {
// Upper limit is lower than oldest core version
throw new FailedDependencyException('Invalid version constraint for TYPO3 Core given. Upper limit is lower than oldest core version.', ResultCodes::ERROR_UPLOADEXTENSION_TYPO3DEPENDENCYINCORRECT);
} elseif (version_compare($upper, $newestCoreVersion, '>')) {
}
if (version_compare($upper, $newestCoreVersion, '>')) {
// Upper limit is larger than newest core version
throw new FailedDependencyException('Invalid version constraint for TYPO3 Core given. Upper limit is higher than latest core version.', ResultCodes::ERROR_UPLOADEXTENSION_TYPO3DEPENDENCYINCORRECT);
} elseif (version_compare($lower, $upper, '>')) {
}
if (version_compare($lower, $upper, '>')) {
// Lower limit is higher than upper limit
throw new FailedDependencyException('Invalid version constraint for TYPO3 Core given. Lower limit is higher than upper limit.', ResultCodes::ERROR_UPLOADEXTENSION_TYPO3DEPENDENCYINCORRECT);
}
......@@ -303,4 +308,4 @@ class ExtensionVersion
}
return [$oldestSupportedCoreVersion, $newestCoreVersion];
}
}
\ No newline at end of file
}
......@@ -135,7 +135,7 @@ class tx_ter_api
if ($version->doesExtensionVersionExist()) {
throw new \T3o\Ter\Exception\VersionExistsException(
'Version number ' . htmlspecialchars($version->getVersion()). ' already exists in repository.',
'Version number ' . htmlspecialchars($version->getVersion()) . ' already exists in repository.',
ResultCodes::ERROR_UPLOADEXTENSION_EXTENSIONVERSIONEXISTS
);
}
......
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