Refactor document name sanitization for consistent filename generation

- Introduced FdsDocumentNames class to centralize the logic for sanitizing document names used in downloads.
- Updated FdsMfr to utilize the new SafeFileName method for generating safe filenames.
- Enhanced documentation for FdsDocumentNames and its methods to clarify usage and purpose.
- Added global.json file to configure testing framework settings.
This commit is contained in:
Stefan
2026-09-16 22:18:42 +02:00
parent a60d4c2eaf
commit 944a5bb442
18 changed files with 245 additions and 34 deletions
+13
View File
@@ -37,5 +37,18 @@
which <c>Program.cs</c> calls once at startup before any <see cref="T:fds.FdsMfr"/> use.
</summary>
</member>
<member name="T:fds.FdsDocumentNames">
<summary>
Download-filename sanitising shared by every path that hands a document to the browser —
stored documents (<see cref="M:fds.FdsMfr.GetReportDoc(System.Byte[]@,System.String,System.Boolean)"/>) and documents regenerated on a miss
(<c>IntranetController.HandleReportDoc</c>, ADR 0025) — so both produce the same name for the
same DocumentName. DocumentName is derived from the user-typed invoice title, so it can carry
path separators ("Wartung 2025/26"), stray editor markup and characters Windows rejects.
</summary>
</member>
<member name="M:fds.FdsDocumentNames.SafeFileName(System.String,System.String)">
<param name="documentName">Raw DocumentName (may be null, empty, or wrapped in &lt;p&gt;).</param>
<param name="fallback">Used when nothing usable remains after cleanup.</param>
</member>
</members>
</doc>