From 0d597c1771dce91ee2880ef946f5a9976c6e10d1 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 11 Jun 2007 08:43:47 +0000 Subject: [PATCH 1/1] Don't allow [/;.,?] to be used in display names, as those are used as separator characters by rails when routing, which means a display name containing them will not work as part of a URL. --- app/models/user.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/user.rb b/app/models/user.rb index 7b57b8710..d6cff0f25 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -13,6 +13,7 @@ class User < ActiveRecord::Base validates_length_of :pass_crypt, :minimum => 8 validates_length_of :display_name, :minimum => 3, :allow_nil => true validates_format_of :email, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i + validates_format_of :display_name, :with => /^[^\/;.,?]*$/ before_save :encrypt_password -- 2.43.2