mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
scrub all attempts to do stupid things with page
This commit is contained in:
parent
9ad4b27a50
commit
a00d460ce0
1 changed files with 7 additions and 0 deletions
7
app.rb
7
app.rb
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue