mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
protect against domain change attacks, word wrap for editor
This commit is contained in:
parent
4994de0927
commit
bf7627f7f9
2 changed files with 6 additions and 1 deletions
|
@ -100,8 +100,12 @@ class Site < Sequel::Model
|
|||
if !(values[:domain] =~ /^[a-zA-Z0-9]+\.[a-zA-Z0-9]+$/i)
|
||||
errors.add :domain, "Domain provided is not valid. Must take the form of domain.com"
|
||||
end
|
||||
|
||||
site = Site[domain: values[:domain]]
|
||||
if !site.nil? && site.id != self.id
|
||||
errors.add :domain, "Domain provided is already being used by another site, please choose another."
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def file_path
|
||||
|
|
|
@ -122,6 +122,7 @@ css:
|
|||
setTheme();
|
||||
editor.getSession().setMode("ace/mode/html");
|
||||
editor.getSession().setTabSize(2);
|
||||
editor.getSession().setUseWrapMode(true);
|
||||
editor.setFontSize(14);
|
||||
editor.setShowPrintMargin(false);
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue