mirror of
https://gitea.tendokyu.moe/Kayori/Medusa.net.git
synced 2026-09-28 01:37:59 +03:00
- Refactor handler dispatch to use a parsed GameModel instead of raw model strings (Handler.cs, HandlerService.cs, new GameModel.cs) - Add a Unity asset-extraction subsystem (Abstractions/Extractors/Unity) - Add WriteEventLogHandler, XrpcDouble serialization type - Rename EaCoin*Handler -> *EaCoinHandler for naming consistency - Add PIN/username update and forgot/reset password flows, with a console-logging IEmailSender until real email is wired up - Add a settings page and a theming pass (theme tokens, tailwind config) - Add plugin nav/route/UI-manifest frontend types
20 lines
635 B
C#
20 lines
635 B
C#
using System.Text.RegularExpressions;
|
|
|
|
namespace Abstractions.Extractors.Unity.Helpers;
|
|
|
|
/// <summary>Strips characters that aren't safe in a filename and collapses whitespace to underscores.</summary>
|
|
public static partial class FileNameSanitizer
|
|
{
|
|
[GeneratedRegex("""[<>:"/\\|?*]""")]
|
|
private static partial Regex InvalidCharsRegex();
|
|
|
|
public static string Sanitize(string name)
|
|
{
|
|
var saneName = InvalidCharsRegex().Replace(name, "_");
|
|
saneName = saneName.Replace(' ', '_');
|
|
saneName = saneName.Trim('_').Trim();
|
|
|
|
return string.IsNullOrEmpty(saneName) ? "Untitled" : saneName;
|
|
}
|
|
}
|