diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 0f0a4e6ae..f2e146b2f 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -43,7 +43,7 @@ class SearchController < ApplicationController begin; offset = params[:offset].to_time if params[:offset]; rescue; end # quick jump to an issue - if @question.match(/^#?(\d+)$/) && Issue.visible.find_by_id($1) + if @question.match(/^#?(\d+)$/) && Issue.visible.find_by_id($1.to_i) redirect_to :controller => "issues", :action => "show", :id => $1 return end diff --git a/test/functional/search_controller_test.rb b/test/functional/search_controller_test.rb index b062468a6..58e3ca881 100644 --- a/test/functional/search_controller_test.rb +++ b/test/functional/search_controller_test.rb @@ -133,6 +133,12 @@ class SearchControllerTest < ActionController::TestCase assert_response :success assert_template 'index' end + + def test_large_integer + get :index, :q => '4615713488' + assert_response :success + assert_template 'index' + end def test_tokens_with_quotes get :index, :id => 1, :q => '"good bye" hello "bye bye"'