Wiki autolinks prefer longest title match

This commit is contained in:
Graham Knop 2007-07-30 17:40:29 +00:00
parent aaf7d9cf44
commit 265400a010
2 changed files with 2 additions and 2 deletions

View file

@ -3,7 +3,7 @@
- Fixed a bug in the Collaboration System where posts from the Safari browser - Fixed a bug in the Collaboration System where posts from the Safari browser
would be submitted without changes. would be submitted without changes.
- fix: New pagination breaks SQL Reports with semicolons - fix: New pagination breaks SQL Reports with semicolons
- Wiki autolinks prefer longest title match
7.4.0 7.4.0
- api: Form Controls and Workflow Activities may now include web based helper - api: Form Controls and Workflow Activities may now include web based helper

View file

@ -98,7 +98,7 @@ sub autolinkHtml {
$key =~ s{\)}{\\\)}gxms; # escape parens $key =~ s{\)}{\\\)}gxms; # escape parens
$mapping{$key} = $self->session->url->gateway($mapping{$key}); $mapping{$key} = $self->session->url->gateway($mapping{$key});
} }
my $matchString = join('|', map{quotemeta} keys %mapping); my $matchString = join('|', map{quotemeta} sort {length($b) <=> length($a)} keys %mapping);
my $regexp = qr/($matchString)/i; my $regexp = qr/($matchString)/i;
my @acc = (); my @acc = ();
my $in_a = 0; my $in_a = 0;