make forum post quoting regexp nongreedy
This commit is contained in:
@@ -110,7 +110,7 @@ class ForumPost < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def quoted_response
|
||||
stripped_body = body.gsub(/\[quote\](?:.|\n|\r)+\[\/quote\][\n\r]*/m, "")
|
||||
stripped_body = body.gsub(/\[quote\](?:.|\n|\r)+?\[\/quote\][\n\r]*/m, "")
|
||||
"[quote]\n#{creator_name} said:\n\n#{stripped_body}\n[/quote]\n\n"
|
||||
end
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class Upload < ActiveRecord::Base
|
||||
module ValidationMethods
|
||||
def uploader_is_not_limited
|
||||
if !uploader.can_upload?
|
||||
raise "uploader has reached their daily limit"
|
||||
raise Error.new("uploader has reached their daily limit")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user