... and more
This commit is contained in:
@ -216,7 +216,9 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
String appName = props.getProperty("name");
|
String appName = props.getProperty("name");
|
||||||
String version = props.getProperty("version");
|
String version = props.getProperty("version");
|
||||||
if (appName == null || version == null || appName.length() <= 0 || version.length() <= 0 ||
|
if (appName == null || version == null || appName.length() <= 0 || version.length() <= 0 ||
|
||||||
appName.startsWith(".") || appName.indexOf("/") > 0 || appName.indexOf("\\") > 0) {
|
appName.indexOf("<") >= 0 || appName.indexOf(">") >= 0 ||
|
||||||
|
version.indexOf("<") >= 0 || version.indexOf(">") >= 0 ||
|
||||||
|
appName.startsWith(".") || appName.indexOf("/") >= 0 || appName.indexOf("\\") >= 0) {
|
||||||
to.delete();
|
to.delete();
|
||||||
updateStatus("<b>" + _("Plugin from {0} has invalid name or version", url) + "</b>");
|
updateStatus("<b>" + _("Plugin from {0} has invalid name or version", url) + "</b>");
|
||||||
return;
|
return;
|
||||||
@ -229,7 +231,7 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
|
|
||||||
// todo compare sud version with property version
|
// todo compare sud version with property version
|
||||||
|
|
||||||
String minVersion = props.getProperty("min-i2p-version");
|
String minVersion = ConfigClientsHelper.stripHTML(props, "min-i2p-version");
|
||||||
if (minVersion != null &&
|
if (minVersion != null &&
|
||||||
(new VersionComparator()).compare(CoreVersion.VERSION, minVersion) < 0) {
|
(new VersionComparator()).compare(CoreVersion.VERSION, minVersion) < 0) {
|
||||||
to.delete();
|
to.delete();
|
||||||
@ -237,7 +239,7 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
minVersion = props.getProperty("min-java-version");
|
minVersion = ConfigClientsHelper.stripHTML(props, "min-java-version");
|
||||||
if (minVersion != null &&
|
if (minVersion != null &&
|
||||||
(new VersionComparator()).compare(System.getProperty("java.version"), minVersion) < 0) {
|
(new VersionComparator()).compare(System.getProperty("java.version"), minVersion) < 0) {
|
||||||
to.delete();
|
to.delete();
|
||||||
@ -279,14 +281,14 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
updateStatus("<b>" + _("New plugin version {0} is not newer than installed plugin", version) + "</b>");
|
updateStatus("<b>" + _("New plugin version {0} is not newer than installed plugin", version) + "</b>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
minVersion = props.getProperty("min-installed-version");
|
minVersion = ConfigClientsHelper.stripHTML(props, "min-installed-version");
|
||||||
if (minVersion != null &&
|
if (minVersion != null &&
|
||||||
(new VersionComparator()).compare(minVersion, oldVersion) > 0) {
|
(new VersionComparator()).compare(minVersion, oldVersion) > 0) {
|
||||||
to.delete();
|
to.delete();
|
||||||
updateStatus("<b>" + _("Plugin update requires installed version {0} or higher", minVersion) + "</b>");
|
updateStatus("<b>" + _("Plugin update requires installed version {0} or higher", minVersion) + "</b>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String maxVersion = props.getProperty("max-installed-version");
|
String maxVersion = ConfigClientsHelper.stripHTML(props, "max-installed-version");
|
||||||
if (maxVersion != null &&
|
if (maxVersion != null &&
|
||||||
(new VersionComparator()).compare(maxVersion, oldVersion) < 0) {
|
(new VersionComparator()).compare(maxVersion, oldVersion) < 0) {
|
||||||
to.delete();
|
to.delete();
|
||||||
|
Reference in New Issue
Block a user