mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +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
|
@ -55,7 +55,7 @@ post '/supporter/update' do
|
||||||
plan: plan_type
|
plan: plan_type
|
||||||
)
|
)
|
||||||
rescue Stripe::CardError => e
|
rescue Stripe::CardError => e
|
||||||
flash[:error] = "Error: #{Rack::Utils.escape_html e.message}"
|
flash[:error] = "Error: #{Rack::Utils.escape_html e.message} This is likely caused by incorrect information, or an issue with your credit card. Please try again, or contact your bank."
|
||||||
redirect '/supporter'
|
redirect '/supporter'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,14 @@ class SiteFile < Sequel::Model
|
||||||
current_path = self.path
|
current_path = self.path
|
||||||
new_path = site.scrubbed_path new_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 == ''
|
if new_path == ''
|
||||||
return false, 'cannot rename to empty path'
|
return false, 'cannot rename to empty path'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue