return false;
}
- // wildcard versions are checked on the server side
- if (version.indexOf("*") === -1) {
- if (!Instructions.versionRegExp.test(version)) {
+ // Allow either a single asterisk, an asterisk in the last digit or a regular version.
+ if (version !== '*') {
+ if (!Instructions.versionRegExp.test(version.replace(/\.\*$/, ".0"))) {
DomUtil.innerError(inputField, Language.get("wcf.acp.devtools.project.packageVersion.error.format"));
return false;
}
- } else if (!Instructions.versionRegExp.test(version.replace("*", "0"))) {
- DomUtil.innerError(inputField, Language.get("wcf.acp.devtools.project.packageVersion.error.format"));
-
- return false;
}
// remove outdated errors
Util_1.default.innerError(inputField, Language.get("wcf.acp.devtools.project.packageVersion.error.maximumLength"));
return false;
}
- // wildcard versions are checked on the server side
- if (version.indexOf("*") === -1) {
- if (!Instructions.versionRegExp.test(version)) {
+ // Allow either a single asterisk, an asterisk in the last digit or a regular version.
+ if (version !== '*') {
+ if (!Instructions.versionRegExp.test(version.replace(/\.\*$/, ".0"))) {
Util_1.default.innerError(inputField, Language.get("wcf.acp.devtools.project.packageVersion.error.format"));
return false;
}
}
- else if (!Instructions.versionRegExp.test(version.replace("*", "0"))) {
- Util_1.default.innerError(inputField, Language.get("wcf.acp.devtools.project.packageVersion.error.format"));
- return false;
- }
// remove outdated errors
Util_1.default.innerError(inputField, "");
return true;
use wcf\data\application\Application;
use wcf\data\package\installation\plugin\PackageInstallationPlugin;
use wcf\data\package\installation\plugin\PackageInstallationPluginList;
-use wcf\data\package\Package;
use wcf\system\application\ApplicationHandler;
use wcf\system\form\builder\field\AbstractFormField;
use wcf\system\form\builder\field\TDefaultIdFormField;
return false;
}
- if (\strpos($instructions['fromVersion'], '*') !== false) {
- if (!Package::isValidVersion(\str_replace('*', '0', $instructions['fromVersion']))) {
- return false;
- }
- } elseif (!Package::isValidVersion($instructions['fromVersion'])) {
- return false;
- }
+ // Do not validate the actual version. The actual installation process
+ // does not validate it either and we should not *silently* drop uncommon
+ // (but valid) formats.
+ // The JavaScript validation should be sufficient to nudge the user
+ // into the correct direction.
}
foreach ($instructions['instructions'] as $instruction) {