What changed, and why it matters
This commit updates a single test file so that a language-pack test reads the list of downloadable languages from a shared service class instead of parsing a Razor view file directly. It is a test maintenance/refactoring change with no visible security relevance.
Recommended action
No security action needed; treat as routine test maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff in BTCPayServer.Tests/UtilitiesTests.cs replaces a Regex-based extraction of hardcoded
Changed components
BTCPayServer.Tests/UtilitiesTests.csInspect captured patch +3 / −10
diff --git a/BTCPayServer.Tests/UtilitiesTests.cs b/BTCPayServer.Tests/UtilitiesTests.cs
index d62a99d..f1c02b4 100644
--- a/BTCPayServer.Tests/UtilitiesTests.cs
+++ b/BTCPayServer.Tests/UtilitiesTests.cs
@@ -14,6 +14,7 @@ using Amazon.Runtime.Internal;
using BTCPayServer.Client;
using BTCPayServer.Client.Models;
using BTCPayServer.Controllers;
+using BTCPayServer.Services;
using ExchangeSharp;
using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc.Localization;
@@ -218,15 +219,7 @@ namespace BTCPayServer.Tests
.OrderBy(l => l)
.ToList();
- var soldir = TestUtils.TryGetSolutionDirectoryInfo();
- var cshtmlContent = File.ReadAllText(Path.Combine(soldir.FullName, "BTCPayServer/Views/UIServer/ListDictionaries.cshtml"));
- var hardcodedLanguages = Regex.Matches(cshtmlContent, @"<option value=""([^""]+)"">")
- .Cast<Match>()
- .Select(m => m.Groups[1].Value)
- .Where(v => v != "")
- .OrderBy(l => l)
- .ToList();
-
+ var hardcodedLanguages = LanguagePackUpdateService.GetDownloadableLanguages();
var missingLanguages = availableLanguages.Except(hardcodedLanguages).ToList();
var extraLanguages = hardcodedLanguages.Except(availableLanguages).ToList();
@@ -234,7 +227,7 @@ namespace BTCPayServer.Tests
$"Language packs list is out of date.\n" +
(missingLanguages.Any() ? $"Missing: {string.Join(", ", missingLanguages)}\n" : "") +
(extraLanguages.Any() ? $"Extra: {string.Join(", ", extraLanguages)}\n" : "") +
- "Update BTCPayServer/Views/UIServer/ListDictionaries.cshtml");
+ "Update BTCPayServer/Services/LanguagePackUpdateService.cs");
}
/// <summary>
Risk score
Our methodology →Why this scored 15/100
Human-validated context
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
No validated notes yet.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.