diff options
Diffstat (limited to 'src/wix/WixToolset.Core/ExtensibilityServices/ParseHelper.cs')
-rw-r--r-- | src/wix/WixToolset.Core/ExtensibilityServices/ParseHelper.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/wix/WixToolset.Core/ExtensibilityServices/ParseHelper.cs b/src/wix/WixToolset.Core/ExtensibilityServices/ParseHelper.cs index 31607b02..5f4ac726 100644 --- a/src/wix/WixToolset.Core/ExtensibilityServices/ParseHelper.cs +++ b/src/wix/WixToolset.Core/ExtensibilityServices/ParseHelper.cs | |||
@@ -246,9 +246,9 @@ namespace WixToolset.Core.ExtensibilityServices | |||
246 | { | 246 | { |
247 | this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, elementName, "Variable")); | 247 | this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, elementName, "Variable")); |
248 | } | 248 | } |
249 | else | 249 | else if (!this.IsValidLocIdentifier(variable) && !Common.IsValidBinderVariable(variable)) |
250 | { | 250 | { |
251 | this.BundleValidator.ValidateBundleVariableName(sourceLineNumbers, elementName, "Variable", variable, allowBuiltIn: false); | 251 | this.BundleValidator.ValidateBundleVariableNameValue(sourceLineNumbers, elementName, "Variable", variable, BundleVariableNameRule.CanBeWellKnown | BundleVariableNameRule.CanHaveReservedPrefix); |
252 | } | 252 | } |
253 | 253 | ||
254 | section.AddSymbol(new WixSearchSymbol(sourceLineNumbers, id) | 254 | section.AddSymbol(new WixSearchSymbol(sourceLineNumbers, id) |
@@ -322,19 +322,19 @@ namespace WixToolset.Core.ExtensibilityServices | |||
322 | 322 | ||
323 | if (!String.IsNullOrEmpty(variableId?.Id)) | 323 | if (!String.IsNullOrEmpty(variableId?.Id)) |
324 | { | 324 | { |
325 | this.BundleValidator.ValidateBundleVariableName(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, variableId.Id, allowBuiltIn: false); | 325 | this.BundleValidator.ValidateBundleVariableNameDeclaration(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, variableId.Id); |
326 | } | 326 | } |
327 | 327 | ||
328 | return variableId; | 328 | return variableId; |
329 | } | 329 | } |
330 | 330 | ||
331 | public string GetAttributeBundleVariableNameValue(SourceLineNumber sourceLineNumbers, XAttribute attribute) | 331 | public string GetAttributeBundleVariableNameValue(SourceLineNumber sourceLineNumbers, XAttribute attribute, BundleVariableNameRule nameRule = BundleVariableNameRule.CanBeWellKnown | BundleVariableNameRule.CanHaveReservedPrefix) |
332 | { | 332 | { |
333 | var variableName = this.GetAttributeValue(sourceLineNumbers, attribute); | 333 | var variableName = this.GetAttributeValue(sourceLineNumbers, attribute); |
334 | 334 | ||
335 | if (!String.IsNullOrEmpty(variableName)) | 335 | if (!String.IsNullOrEmpty(variableName) && !this.IsValidLocIdentifier(variableName) && !Common.IsValidBinderVariable(variableName)) |
336 | { | 336 | { |
337 | this.BundleValidator.ValidateBundleVariableName(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, variableName, allowBuiltIn: false); | 337 | this.BundleValidator.ValidateBundleVariableNameValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, variableName, nameRule); |
338 | } | 338 | } |
339 | 339 | ||
340 | return variableName; | 340 | return variableName; |