From 8e3f07a788d51d10adbcd6c0830a4450954d9428 Mon Sep 17 00:00:00 2001 From: Joe Shook Date: Mon, 7 Oct 2024 07:02:09 -0700 Subject: [PATCH] Fix code scanning alert no. 40: Log entries created from user input Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- Udap.Common/Metadata/UdapMetaDataBuilder.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Udap.Common/Metadata/UdapMetaDataBuilder.cs b/Udap.Common/Metadata/UdapMetaDataBuilder.cs index d6907680..b2ed943b 100644 --- a/Udap.Common/Metadata/UdapMetaDataBuilder.cs +++ b/Udap.Common/Metadata/UdapMetaDataBuilder.cs @@ -101,7 +101,8 @@ public string GetCommunitiesAsHtml(string path) if (certificate == null) { - _logger.LogWarning("Missing default community certificate: {Community}", System.Web.HttpUtility.UrlEncode(community)); + var sanitizedCommunity = System.Web.HttpUtility.UrlEncode(community).Replace(Environment.NewLine, "").Replace("\n", "").Replace("\r", ""); + _logger.LogWarning("Missing default community certificate: {Community}", sanitizedCommunity); return null; }