Skip to content

Commit

Permalink
[JENKINS-9283] - Don't accept invalid timezones, add form validation
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-nenashev authored and daniel-beck committed Jun 26, 2017
1 parent b171bc6 commit f6176bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/scheduler/CronTabList.java
Expand Up @@ -108,9 +108,9 @@ public static CronTabList create(@Nonnull String format, Hash hash) throws ANTLR
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;
}
Expand Down
Expand Up @@ -89,7 +89,7 @@
</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()
Expand Down

0 comments on commit f6176bc

Please sign in to comment.