[JENKINS-9283] - Don't accept invalid timezones, add form validation

This commit is contained in:
Oleg Nenashev authored and Daniel Beck committed 2017-06-26 18:03:39 +02:00
1 parent b171bc6053
commit f6176bc19d
2 files changed
+3 -3

No files matched your search

@@ -108,9 +108,9 @@ public final class CronTabList {
if(lineNumber == 1 && line.startsWith("TZ=")) {
timezone = getValidTimezone(line.replace("TZ=",""));
if(timezone != null) {
LOGGER.log(Level.CONFIG, "cron with timezone {0}", timezone);
LOGGER.log(Level.CONFIG, "CRON with timezone {0}", timezone);
} else {
LOGGER.log(Level.CONFIG, "invalid timezone {0}", line);
throw new ANTLRException("Invalid or unsupported timezone '" + line + "'");
}
continue;
}
@@ -89,7 +89,7 @@ H H 1,15 1-11 *
</p>
<ul>
<li>Timezone specification should contain the &quot;TZ=$(timezoneID)&quot; string</li>
<li>If a timezone is not specified or if it is specified incorrectly, the default Jenkins JVM timezone will be used</li>
<li>If a timezone is not specified, the default Jenkins JVM timezone will be used</li>
<li>Th supports all timezones returned by
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html#getAvailableIDs()">
java.util.TimeZone::getAvailableIDs()