diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a20b8d6..f97cc06 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -703,7 +703,7 @@ module ApplicationHelper oid = identifier.to_i case prefix when nil - if issue = Issue.visible.find_by_id(oid, :include => :status) + if oid.to_s == identifier && issue = Issue.visible.find_by_id(oid, :include => :status) anchor = comment_id ? "note-#{comment_id}" : nil link = link_to("##{oid}", {:only_path => only_path, :controller => 'issues', :action => 'show', :id => oid, :anchor => anchor}, :class => issue.css_classes, diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 8b22df0..1740fbc 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -260,6 +260,8 @@ RAW # ticket notes '#3-14' => note_link, '#3#note-14' => note_link, + # should not ignore leading zero + '#03' => '#03', # changesets 'r1' => changeset_link, 'r1.' => "#{changeset_link}.",