diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 744c3a3cb..e192b855b 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -37,7 +37,7 @@ class SearchController < ApplicationController end # quick jump to an issue - if (m = @question.match(/^#?(\d+)$/)) && (issue = Issue.visible.find_by_id(m[1].to_i)) + if !api_request? && (m = @question.match(/^#?(\d+)$/)) && (issue = Issue.visible.find_by_id(m[1].to_i)) redirect_to issue_path(issue) return end diff --git a/test/functional/search_controller_test.rb b/test/functional/search_controller_test.rb index f5b52b2b4..580746235 100644 --- a/test/functional/search_controller_test.rb +++ b/test/functional/search_controller_test.rb @@ -388,6 +388,11 @@ class SearchControllerTest < Redmine::ControllerTest assert_response :success end + def test_should_not_quick_jump_for_api_requests + get '/search.xml', :params => {:q => '3'} + assert_response :success + end + def test_large_integer get :index, :params => {:q => '4615713488'} assert_response :success