mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 09:12:35 +00:00
Improved server nickname validation
This commit is contained in:
@@ -448,7 +448,11 @@ class W3DHub
|
||||
prefill: Store.settings[:server_list_username],
|
||||
accept_callback: accept_callback,
|
||||
cancel_callback: cancel_callback,
|
||||
valid_callback: proc { |entry| entry.length.positive? }
|
||||
# See: https://gitlab.com/danpaul88/brenbot/-/blob/master/Source/renlog.pm#L136-175
|
||||
valid_callback: proc do |entry|
|
||||
entry.length > 1 && entry.length < 30 && (entry =~ /(:|!|&|%| )/i).nil? &&
|
||||
(entry =~ /[\001\002\037]/).nil? && (entry =~ /\\/).nil?
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user