persist browse page search prefs, scrub not allowed chars for tag entry

This commit is contained in:
Kyle Drake 2025-03-25 11:49:49 -05:00
parent 2a76e75c6f
commit 321f8c6e29
3 changed files with 35 additions and 6 deletions

View file

@ -2,6 +2,11 @@ get '/browse/?' do
@page = params[:page]
@page = 1 if @page.not_an_integer?
if params[:tag]
params[:tag] = params[:tag].gsub(Tag::INVALID_TAG_REGEX, '').gsub(/\s+/, '').slice(0, Tag::NAME_LENGTH_MAX)
@title = "Sites tagged #{params[:tag]}"
end
if is_education?
ds = education_sites_dataset
else
@ -20,10 +25,6 @@ get '/browse/?' do
@site_tags[site_id] = tags.select {|t| t[:site_id] == site_id}.collect {|t| t[:name]}
end
if params[:tag]
@title = "Sites tagged #{params[:tag]}"
end
erb :browse
end