scrub all attempts to do stupid things with page

This commit is contained in:
Kyle Drake 2024-08-20 11:29:38 -05:00
parent 9ad4b27a50
commit a00d460ce0

7
app.rb
View file

@ -85,6 +85,13 @@ before do
content_type :html, 'charset' => 'utf-8'
redirect '/' if request.post? && !csrf_safe?
end
if params[:page]
params[:page] = params[:page].to_s
unless params[:page] =~ /^\d+$/ && params[:page].to_i > 0
params[:page] = '1'
end
end
end
after do