mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
prevent www. in domain names
This commit is contained in:
parent
2b526d85ed
commit
9b493483b7
1 changed files with 6 additions and 0 deletions
|
@ -115,6 +115,12 @@ post '/settings/:username/custom_domain' do
|
|||
original_domain = @site.domain
|
||||
@site.domain = params[:domain]
|
||||
|
||||
if params[:domain] =~ /^www\..+$/i
|
||||
flash[:error] = 'Cannot begin with www - please only enter the domain name.'
|
||||
redirect "/settings/#{@site.username}/#custom_domain"
|
||||
|
||||
end
|
||||
|
||||
begin
|
||||
Socket.gethostbyname @site.values[:domain]
|
||||
rescue SocketError => e
|
||||
|
|
Loading…
Add table
Reference in a new issue