mirror of
https://github.com/neocities/neocities.git
synced 2025-07-22 02:26:07 +02:00
more strict integer checks
This commit is contained in:
parent
1d87b87e62
commit
f7e65ec61b
10 changed files with 30 additions and 21 deletions
|
@ -1,13 +1,8 @@
|
|||
get '/browse/?' do
|
||||
@surfmode = false
|
||||
|
||||
begin
|
||||
@page = params[:page].to_i
|
||||
rescue
|
||||
@page = 1
|
||||
end
|
||||
|
||||
@page = 1 if @page == 0
|
||||
@page = params[:page]
|
||||
@page = 1 if @page.not_an_integer?
|
||||
|
||||
params.delete 'tag' if params[:tag].nil? || params[:tag].strip.empty?
|
||||
|
||||
|
@ -17,7 +12,7 @@ get '/browse/?' do
|
|||
ds = browse_sites_dataset
|
||||
end
|
||||
|
||||
ds = ds.paginate @page, Site::BROWSE_PAGINATION_LENGTH
|
||||
ds = ds.paginate @page.to_i, Site::BROWSE_PAGINATION_LENGTH
|
||||
@pagination_dataset = ds
|
||||
@sites = ds.all
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue