mirror of
https://github.com/neocities/neocities.git
synced 2025-07-21 01:56:03 +02:00
patch XSS related to directories, remove redundant text editor file load
This commit is contained in:
parent
eed42b7558
commit
e95dd99c29
3 changed files with 36 additions and 36 deletions
|
@ -32,7 +32,7 @@ post '/site_files/create' do
|
|||
name = current_site.scrubbed_path name
|
||||
|
||||
if current_site.file_exists?(name)
|
||||
flash[:error] = %{Web page "#{name}" already exists! Choose another name.}
|
||||
flash[:error] = %{Web page "#{Rack::Utils.escape_html name}" already exists! Choose another name.}
|
||||
redirect redirect_uri
|
||||
end
|
||||
|
||||
|
@ -67,7 +67,9 @@ post '/site_files/create' do
|
|||
site_file.save
|
||||
end
|
||||
|
||||
flash[:success] = %{#{name} was created! <a style="color: #FFFFFF; text-decoration: underline" href="/site_files/text_editor/#{name}">Click here to edit it</a>.}
|
||||
escaped_name = Rack::Utils.escape_html name
|
||||
|
||||
flash[:success] = %{#{escaped_name} was created! <a style="color: #FFFFFF; text-decoration: underline" href="/site_files/text_editor/#{escaped_name}">Click here to edit it</a>.}
|
||||
|
||||
redirect redirect_uri
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue