Merged r4860 from trunk.
scm: fix diff revision param validation. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.1-stable@4877 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
008d38d6b4
commit
1e50fea55a
|
@ -213,7 +213,7 @@ class RepositoriesController < ApplicationController
|
||||||
@rev = params[:rev].blank? ? @repository.default_branch : params[:rev].strip
|
@rev = params[:rev].blank? ? @repository.default_branch : params[:rev].strip
|
||||||
@rev_to = params[:rev_to]
|
@rev_to = params[:rev_to]
|
||||||
|
|
||||||
unless @rev.to_s.match(REV_PARAM_RE) && @rev.to_s.match(REV_PARAM_RE)
|
unless @rev.to_s.match(REV_PARAM_RE) && @rev_to.to_s.match(REV_PARAM_RE)
|
||||||
if @repository.branches.blank?
|
if @repository.branches.blank?
|
||||||
raise InvalidRevisionParam
|
raise InvalidRevisionParam
|
||||||
end
|
end
|
||||||
|
|
|
@ -172,6 +172,12 @@ class RepositoriesSubversionControllerTest < ActionController::TestCase
|
||||||
assert_error_tag :content => /was not found/
|
assert_error_tag :content => /was not found/
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_invalid_revision_diff
|
||||||
|
get :diff, :id => 1, :rev => '1', :rev_to => 'something_weird'
|
||||||
|
assert_response 404
|
||||||
|
assert_error_tag :content => /was not found/
|
||||||
|
end
|
||||||
|
|
||||||
def test_empty_revision
|
def test_empty_revision
|
||||||
['', ' ', nil].each do |r|
|
['', ' ', nil].each do |r|
|
||||||
get :revision, :id => 1, :rev => r
|
get :revision, :id => 1, :rev => r
|
||||||
|
|
Loading…
Reference in New Issue