From 86f8f722f4e04feede9a4d52cbf7a3201a6ff041 Mon Sep 17 00:00:00 2001 From: Oliver Wu Date: Fri, 15 Aug 2025 15:15:25 -0400 Subject: [PATCH] Fix restrictive regex validation for descriptions in IDL files **Problem:** The ACT build process was failing when IDL descriptions contained common special characters like ampersand (&) and hash (#), throwing validation errors such as: "invalid description for method CrsObject.GetName" **Root Cause:** Two regex patterns in componentdefinition.go were overly restrictive: 1. `descriptionIsValid()` - for method/class/function descriptions 2. `errorDescriptionIsValid()` - for error descriptions These patterns excluded commonly used characters that are safe and appropriate for documentation text. **Solution:** Expanded both regex patterns to include additional safe characters: - & (ampersand) - for logical conjunctions - # (hash/pound) - for identifiers, issue numbers, etc. - @ (at symbol) - for references, email-like notation - % (percent) - for percentages, placeholders - $ (dollar) - for currency, variables - * (asterisk) - for emphasis, wildcards --- Source/componentdefinition.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/componentdefinition.go b/Source/componentdefinition.go index 24be9903..c6c1deac 100644 --- a/Source/componentdefinition.go +++ b/Source/componentdefinition.go @@ -424,7 +424,7 @@ func (component *ComponentDefinition) checkErrors() error { } func errorDescriptionIsValid (name string) bool { - var IsValidIdentifier = regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_+\\-:,.=!/ ]*$").MatchString + var IsValidIdentifier = regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_+\\-:,.=!/#@%$* ]*$").MatchString if (name != "") { return IsValidIdentifier(name); @@ -789,7 +789,7 @@ func nameIsValidIdentifier(name string) bool { } func descriptionIsValid(description string) bool { - var IsValidMethodDescription = regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_\\\\/+\\-:,.=!?()'; |]*$").MatchString + var IsValidMethodDescription = regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_\\\\/+\\-:,.=!?()';&#@%$* |]*$").MatchString if (description != "") { return IsValidMethodDescription(description); }