mirror of
https://github.com/neocities/neocities.git
synced 2025-08-25 18:33:33 +02:00
catch file name too long
This commit is contained in:
parent
5571a5913f
commit
3a2cc571e2
2 changed files with 19 additions and 0 deletions
|
@ -37,6 +37,11 @@ post '/site_files/create' do
|
|||
redirect redirect_uri
|
||||
end
|
||||
|
||||
if SiteFile.name_too_long?(name)
|
||||
flash[:error] = "File name is too long (exceeds #{SiteFile::FILE_NAME_CHARACTER_LIMIT} characters)."
|
||||
redirect redirect_uri
|
||||
end
|
||||
|
||||
extname = File.extname name
|
||||
|
||||
unless extname.empty? || extname.match(/^\.#{Site::EDITABLE_FILE_EXT}/i)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue