Skip to content

Commit 935963c

Browse files
committed
Revert regex pattern to string interpolation - concatenation broke GUID extraction
The concatenation approach suggested by Copilot broke the regex matching. Reverting to the original string interpolation which works correctly. String interpolation in static contexts is fine for this use case.
1 parent e9ca6f8 commit 935963c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Services/ContentHubLinkService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class ContentHubLinkService : IContentHubLinkService
3838
// Matches /getcontentasset/{contentItemGuid}/{assetGuid}
3939
// Guid.TryParse() handles actual GUID validation, so we just capture word characters and hyphens
4040
private static readonly Regex contentItemLinkRegex = new(
41-
@"\/getcontentasset\/(?<" + CONTENT_ITEM_GROUP_NAME + @">[\w-]+)\/[\w-]+",
41+
$@"\/getcontentasset\/(?<{CONTENT_ITEM_GROUP_NAME}>[\w-]+)\/[\w-]+",
4242
RegexOptions.Compiled | RegexOptions.IgnoreCase
4343
);
4444

0 commit comments

Comments
 (0)