app/controllers/elt_controller.rb in parlement-0.11 vs app/controllers/elt_controller.rb in parlement-0.12
- old
+ new
@@ -15,11 +15,11 @@
@title = @elt.subject
@title += " (parlement)" if !@title.downcase.include? "parlement"
render :layout => 'top'
rescue ActiveRecord::RecordNotFound => e
- flash[:error] = "Element '#{params[:id]}' does not exist"
+ flash[:error] = _("Element %s does not exist") % params[:id]
headers["Status"] = "301 Moved Permanently"
redirect_to '/'
end
def list
@@ -65,10 +65,10 @@
@elt = Elt.new(params[:elt])
@elt.person = session[:person]
if !session[:person] and \
(@elt.subject =~ /([<>\/]|href)/ \
- or @elt.body =~ /(.*(http|href).*){3}/ \
+ or @elt.body =~ /(.*(http|href)(.*\n)*){3}/ \
or @elt.body =~ /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i \
or @elt.body =~ /([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,}.*){3}/i) then
logger.error red { underline { "SPAM! '#{@elt.subject}'" } }
logger.error "SPAM! '#{@elt.body}'"
flash[:error] = 'Sorry, to fight spam "<" ">" or "href" are forbidden in the subject, and there can not be more than 3 links in the body, you also can\'t input one simple email or more than 3 emails!'