make forum post quoting regexp nongreedy

This commit is contained in:
albert
2013-02-22 12:24:10 -05:00
parent 804055aac7
commit bbb8767b29
10 changed files with 35 additions and 18 deletions

View File

@@ -9,9 +9,19 @@ class ApplicationController < ActionController::Base
layout "default"
rescue_from User::PrivilegeError, :with => :access_denied
rescue_from Danbooru::Paginator::PaginationError, :with => :render_pagination_limit
protected
def rescue_exception(exception)
@exception = exception
render :action => "static/error", :status => 500
end
def render_pagination_limit
@error_message = "You can view up to 1,000 pages. Please narrow your search terms."
render :action => "static/error", :status => 410
end
def access_denied
previous_url = params[:url] || request.fullpath

View File

@@ -1,5 +1,6 @@
class LegacyController < ApplicationController
before_filter :member_only, :only => [:create_post]
rescue_from PostSets::SearchError, :with => :error
def posts
@post_set = PostSets::Post.new(tag_query, params[:page], params[:limit])
@@ -30,6 +31,9 @@ class LegacyController < ApplicationController
def unavailable
render :text => "this resource is no longer available", :status => 410
end
def error
end
private
def tag_query

View File

@@ -2,9 +2,8 @@ class PostsController < ApplicationController
before_filter :member_only, :except => [:show, :index]
after_filter :save_recent_tags, :only => [:update]
respond_to :html, :xml, :json
rescue_from PostSets::SearchError, :with => :search_error
rescue_from Post::SearchError, :with => :search_error
rescue_from Danbooru::Paginator::PaginationError, :with => :search_error
rescue_from PostSets::SearchError, :with => :rescue_exception
rescue_from Post::SearchError, :with => :rescue_exception
def index
@post_set = PostSets::Post.new(tag_query, params[:page], params[:limit])
@@ -55,16 +54,8 @@ class PostsController < ApplicationController
format.js
end
end
def error
end
private
def search_error(exception)
@exception = exception
render :action => "error"
end
def tag_query
params[:tags] || (params[:post] && params[:post][:tags])
end

View File

@@ -1,6 +1,7 @@
class UploadsController < ApplicationController
before_filter :member_only
respond_to :html, :xml, :json, :js
rescue_from Upload::Error, :with => :rescue_exception
def new
@upload = Upload.new(:rating => "q")