Defect #13005

Can't link to changeset or source in repository that contains underscores

Added by A B over 4 years ago. Updated over 4 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Text formatting
Target version:-
Resolution:Duplicate Affected version:2.2.2

Description

If the repository identifier contains underscores (which is legal according to the help text when adding a repository) then the commit:<repo>|<changeset> and source:&lt;repo&gt;|<changeset> links will not be created. The reason is that the regexp to match the repository identifier is missing the underscore. The following patch fixes this:

--- app/helpers/application_helper.rb.orig    2013-01-20 12:05:33.000000000 -0800
+++ app/helpers/application_helper.rb    2013-01-28 01:35:29.820872421 -0800
@@ -793,7 +793,7 @@
           when 'commit', 'source', 'export'
             if project
               repository = nil
-              if name =~ %r{^(([a-z0-9\-]+)\|)(.+)$}
+              if name =~ %r{^(([a-z0-9_\-]+)\|)(.+)$}
                 repo_prefix, repo_identifier, name = $1, $2, $3
                 repository = project.repositories.detect {|repo| repo.identifier == repo_identifier}
               else


Related issues

Duplicates Redmine - Defect #12979: Wiki link syntax commit:repo_a:abcd doesn't work Closed

History

#1 Updated by Etienne Massip over 4 years ago

  • Status changed from New to Closed
  • Resolution set to Duplicate

I think it's a dupe of #12979, fixed for 2.2.3.

Also available in: Atom PDF