diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/api/wix/WixToolset.Data/ErrorMessages.cs | 2 | ||||
| -rw-r--r-- | src/wix/WixToolset.Core/CompilerCore.cs | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/api/wix/WixToolset.Data/ErrorMessages.cs b/src/api/wix/WixToolset.Data/ErrorMessages.cs index 23ba5151..1d02ffd0 100644 --- a/src/api/wix/WixToolset.Data/ErrorMessages.cs +++ b/src/api/wix/WixToolset.Data/ErrorMessages.cs | |||
| @@ -1163,7 +1163,7 @@ namespace WixToolset.Data | |||
| 1163 | 1163 | ||
| 1164 | public static Message InvalidDateTimeFormat(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) | 1164 | public static Message InvalidDateTimeFormat(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) |
| 1165 | { | 1165 | { |
| 1166 | return Message(sourceLineNumbers, Ids.InvalidDateTimeFormat, "The {0}/@{1} attribute's value '{2}' is not a valid date/time value. A date/time value should follow the format YYYY-MM-DDTHH:mm:ss.", elementName, attributeName, value); | 1166 | return Message(sourceLineNumbers, Ids.InvalidDateTimeFormat, "The {0}/@{1} attribute's value '{2}' is not a valid date/time value. A date/time value should follow the format YYYY-MM-DDTHH:mm:ss and be a valid date and time between 1980 and 2043, inclusive.", elementName, attributeName, value); |
| 1167 | } | 1167 | } |
| 1168 | 1168 | ||
| 1169 | public static Message InvalidDocumentElement(SourceLineNumber sourceLineNumbers, string elementName, string fileType, string expectedElementName) | 1169 | public static Message InvalidDocumentElement(SourceLineNumber sourceLineNumbers, string elementName, string fileType, string expectedElementName) |
diff --git a/src/wix/WixToolset.Core/CompilerCore.cs b/src/wix/WixToolset.Core/CompilerCore.cs index 8d1c7e0a..57d84c3a 100644 --- a/src/wix/WixToolset.Core/CompilerCore.cs +++ b/src/wix/WixToolset.Core/CompilerCore.cs | |||
| @@ -550,6 +550,11 @@ namespace WixToolset.Core | |||
| 550 | { | 550 | { |
| 551 | DateTime date = DateTime.Parse(value, CultureInfo.InvariantCulture.DateTimeFormat); | 551 | DateTime date = DateTime.Parse(value, CultureInfo.InvariantCulture.DateTimeFormat); |
| 552 | 552 | ||
| 553 | if (date.Year < 1980 || date.Year > 2043) | ||
| 554 | { | ||
| 555 | this.Write(ErrorMessages.InvalidDateTimeFormat(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); | ||
| 556 | } | ||
| 557 | |||
| 553 | return ((((date.Year - 1980) * 512) + (date.Month * 32 + date.Day)) * 65536) + | 558 | return ((((date.Year - 1980) * 512) + (date.Month * 32 + date.Day)) * 65536) + |
| 554 | (date.Hour * 2048) + (date.Minute * 32) + (date.Second / 2); | 559 | (date.Hour * 2048) + (date.Minute * 32) + (date.Second / 2); |
| 555 | } | 560 | } |
