remove monkeypatch that was causing file upload issues

This commit is contained in:
Kyle Drake 2015-03-14 17:49:18 -05:00
parent 82c473351f
commit 3f7f90c9e7
6 changed files with 9 additions and 13 deletions

View file

@ -1,5 +1,5 @@
get '/browse/?' do
params.delete 'tag' if params[:tag].nil? || params[:tag].empty?
params.delete 'tag' if params[:tag].nil? || params[:tag].strip.empty?
site_dataset = browse_sites_dataset
site_dataset = site_dataset.paginate @current_page, Site::BROWSE_PAGINATION_LENGTH
@page_count = site_dataset.page_count || 1
@ -65,4 +65,4 @@ def browse_sites_dataset
end
site_dataset
end
end

View file

@ -27,4 +27,4 @@ post '/contact' do
flash[:success] = 'Your contact has been sent.'
redirect '/'
end
end
end

View file

@ -41,7 +41,7 @@ the Neocities Cat
end
get '/password_reset_confirm' do
if params[:token].nil? || params[:token].empty?
if params[:token].nil? || params[:token].strip.empty?
flash[:error] = 'Could not find a site with this token.'
redirect '/'
end
@ -67,4 +67,4 @@ get '/password_reset_confirm' do
end
redirect '/'
end
end

View file

@ -16,7 +16,7 @@ post '/site_files/create_page' do
params[:pagefilename].gsub!(/[^a-zA-Z0-9_\-.]/, '')
params[:pagefilename].gsub!(/\.html$/i, '')
if params[:pagefilename].nil? || params[:pagefilename].empty?
if params[:pagefilename].nil? || params[:pagefilename].strip.empty?
@errors << 'You must provide a file name.'
halt erb(:'site_files/new_page')
end

View file

@ -1,5 +1,5 @@
get '/surf/?' do
params.delete 'tag' if params[:tag].nil? || params[:tag].empty?
params.delete 'tag' if params[:tag].nil? || params[:tag].strip.empty?
site_dataset = browse_sites_dataset
site_dataset = site_dataset.paginate @current_page, 1
@page_count = site_dataset.page_count || 1
@ -14,4 +14,4 @@ get '/surf/:username' do |username|
@title = @site.title
not_found if @site.nil?
erb :'surf', layout: false
end
end

View file

@ -1,8 +1,4 @@
class String
def empty?
strip == '' ? true : false
end
def shorten(length, usedots=true)
if usedots
return self if self.length < length
@ -15,4 +11,4 @@ class String
def unindent
gsub /^#{scan(/^\s*/).min_by{|l|l.length}}/, ""
end
end
end