mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
Utilise Minutes in TempBan for under 1 hour bans. (#362)
* Update tempban command to use minutes instead of hours The duration calculation for tempbans now uses minutes rather than hours for greater precision. This change ensures better alignment with user expectations and configurations in smaller timeframes. * Update regex patterns to enforce stricter input validation Adjusted regex in `ParseTimespan` and `TempBanCommand` to ensure input starts with 1-5 numeric characters, improving validation. This prevents malformed user inputs and enhances overall command reliability. * \w includes digits. Who knew.
This commit is contained in:
@ -229,7 +229,7 @@ namespace SharedLibraryCore.Commands
|
||||
/// </summary>
|
||||
public class TempBanCommand : Command
|
||||
{
|
||||
private static readonly string TempBanRegex = @"([0-9]+\w+)\ (.+)";
|
||||
private static readonly string TempBanRegex = @"^([0-9]{1,5}\p{L}+)\ (.+)";
|
||||
private readonly ApplicationConfiguration _appConfig;
|
||||
|
||||
public TempBanCommand(ApplicationConfiguration appConfig, CommandConfiguration config,
|
||||
|
Reference in New Issue
Block a user