From b6ebbab8309ea9553c48f24971ba7fe24d99c9b3 Mon Sep 17 00:00:00 2001 From: nwb Date: Fri, 4 Jul 2014 14:19:34 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=89=88=E6=9C=AC=E5=BA=93?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E9=99=90=E5=AE=9A=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/messages_controller.rb | 3 +++ app/models/repository.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 2a408788..2915ff8f 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -87,8 +87,11 @@ class MessagesController < ApplicationController call_hook(:controller_messages_reply_after_save, { :params => params, :message => @reply}) attachments = Attachment.attach_files(@reply, params[:attachments]) render_attachment_warning_if_needed(@reply) + else + #render file: 'messages#show', layout: 'base_courses' end redirect_to board_message_path(@board, @topic, :r => @reply) + end # Edit a message diff --git a/app/models/repository.rb b/app/models/repository.rb index ce7ac9d0..57a81827 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -42,7 +42,7 @@ class Repository < ActiveRecord::Base validates_uniqueness_of :identifier, :scope => :project_id, :allow_blank => true validates_exclusion_of :identifier, :in => %w(show entry raw changes annotate diff show stats graph) # donwcase letters, digits, dashes, underscores but not digits only - validates_format_of :identifier, :with => /\A(?!\d+$)[a-z0-9\-_]*\z/, :allow_blank => true + validates_format_of :identifier, :with => /^[a-zA-Z0-9_\-]+$/, :allow_blank => true # Checks if the SCM is enabled when creating a repository validate :repo_create_validation, :on => :create