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:
@@ -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 <p>).</param>
|
||||
<param name="fallback">Used when nothing usable remains after cleanup.</param>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
|
||||
Reference in New Issue
Block a user