mirror of
https://github.com/neocities/neocities.git
synced 2025-05-14 16:37:20 +02:00
Merge branch 'master' into customdomains
This commit is contained in:
commit
dc0a88b541
4 changed files with 15 additions and 5 deletions
12
app.rb
12
app.rb
|
@ -35,8 +35,9 @@ get '/?' do
|
|||
end
|
||||
|
||||
get '/browse' do
|
||||
@current_page = params[:current_page] || 1
|
||||
@current_page = params[:current_page]
|
||||
@current_page = @current_page.to_i
|
||||
@current_page = 1 if @current_page == 0
|
||||
|
||||
site_dataset = Site.filter(is_banned: false).filter(site_changed: true).paginate(@current_page, 300)
|
||||
|
||||
|
@ -605,3 +606,12 @@ end
|
|||
def template_site_title(username)
|
||||
"#{username.capitalize}#{username[username.length-1] == 's' ? "'" : "'s"} Site"
|
||||
end
|
||||
|
||||
def encoding_fix(file)
|
||||
begin
|
||||
Rack::Utils.escape_html file
|
||||
rescue ArgumentError => e
|
||||
return Rack::Utils.escape_html(file.force_encoding('BINARY')) if e.message =~ /invalid byte sequence in UTF-8/
|
||||
fail
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue