mirror of
https://github.com/meineerde/redmine.git
synced 2026-03-10 19:23:06 +00:00
Fixed search for large integers
This commit is contained in:
parent
6c8fe3c504
commit
f1561ebda9
@ -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+)$/) && $1.to_i <= 2147483647 && Issue.visible.find_by_id($1)
|
||||
redirect_to :controller => "issues", :action => "show", :id => $1
|
||||
return
|
||||
end
|
||||
|
||||
@ -134,6 +134,12 @@ class SearchControllerTest < ActionController::TestCase
|
||||
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"'
|
||||
assert_equal ["good bye", "hello", "bye bye"], assigns(:tokens)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user