mirror of
https://github.com/neocities/neocities.git
synced 2025-06-21 11:50:35 +02:00
better card decline copy - catch renames with too long filenames/paths
This commit is contained in:
parent
623dfd05fc
commit
682f450561
2 changed files with 9 additions and 1 deletions
|
@ -58,6 +58,14 @@ class SiteFile < Sequel::Model
|
|||
current_path = self.path
|
||||
new_path = site.scrubbed_path new_path
|
||||
|
||||
if new_path.length > FILE_PATH_CHARACTER_LIMIT
|
||||
return false, 'new path too long'
|
||||
end
|
||||
|
||||
if File.basename(new_path).length > FILE_NAME_CHARACTER_LIMIT
|
||||
return false, 'new filename too long'
|
||||
end
|
||||
|
||||
if new_path == ''
|
||||
return false, 'cannot rename to empty path'
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue