Index: trunk/tools/bugzilla/bugzilla-4.0/extensions/Wikimedia/Extension.pm |
— | — | @@ -30,41 +30,40 @@ |
31 | 31 | # See the documentation of Bugzilla::Hook ("perldoc Bugzilla::Hook" |
32 | 32 | # in the bugzilla directory) for a list of all available hooks. |
33 | 33 | sub install_update_db { |
34 | | - my ($self, $args) = @_; |
35 | | - |
| 34 | + my ($self, $args) = @_; |
36 | 35 | } |
37 | 36 | |
38 | 37 | sub bug_format_comment { |
39 | | - my ($self, $args) = @_; |
40 | | - my $regexes = $args->{'regexes'}; |
41 | | - my $text = $args->{'text'}; |
42 | | - my $replacerWP = { |
43 | | - match => qr{\[\[([a-zA-Z0-9_ ,./'()!#\*\$%:\x80-\xff-]+)\]\]}, |
44 | | - replace => \&_createWikipediaLink |
45 | | - }; |
| 38 | + my ($self, $args) = @_; |
| 39 | + my $regexes = $args->{'regexes'}; |
| 40 | + my $text = $args->{'text'}; |
| 41 | + my $replacerWP = { |
| 42 | + match => qr{\[\[([a-zA-Z0-9_ ,./'()!#\*\$%:\x80-\xff-]+)\]\]}, |
| 43 | + replace => \&_createWikipediaLink |
| 44 | + }; |
46 | 45 | my $replacerCR = { |
47 | | - match => qr{r(\d+)}, |
48 | | - replace => \&_createCodeReviewLink |
49 | | - }; |
50 | | - #~\br(\d+)\b |
51 | | - # "<a href=\"https://www.mediawiki.org" . |
52 | | - # "/wiki/Special:Code/MediaWiki/$1\" " . |
53 | | - # "title=\"revision $1 in SVN\">r$1</a>" |
| 46 | + match => qr{r(\d+)}, |
| 47 | + replace => \&_createCodeReviewLink |
| 48 | + }; |
| 49 | + #~\br(\d+)\b |
| 50 | + # "<a href=\"https://www.mediawiki.org" . |
| 51 | + # "/wiki/Special:Code/MediaWiki/$1\" " . |
| 52 | + # "title=\"revision $1 in SVN\">r$1</a>" |
54 | 53 | |
55 | | - push( @$regexes, $replacerWP ); |
| 54 | + push( @$regexes, $replacerWP ); |
56 | 55 | push( @$regexes, $replacerCR ); |
57 | 56 | } |
58 | 57 | |
59 | 58 | sub _createWikipediaLink { |
60 | | - my $match_str = $1; |
61 | | - my $tmp = html_quote($match_str); |
62 | | - my $wikipedia_link = "[[<a href='https://en.wikipedia.org/w/index.php?title=Special:Search&go=Go&search=$tmp'>$tmp</a>]]"; |
63 | | - return $wikipedia_link; |
| 59 | + my $match_str = $1; |
| 60 | + my $tmp = html_quote($match_str); |
| 61 | + my $wikipedia_link = "[[<a href='https://en.wikipedia.org/w/index.php?title=Special:Search&go=Go&search=$tmp'>$tmp</a>]]"; |
| 62 | + return $wikipedia_link; |
64 | 63 | }; |
65 | 64 | |
66 | 65 | sub _createCodeReviewLink { |
67 | | - my $rev_link = "<a href=\"https://www.mediawiki.org/wiki/Special:Code/MediaWiki/$1\" title=\"revision $1 in SVN\">r$1</a>"; |
68 | | - return $rev_link; |
| 66 | + my $rev_link = "<a href=\"https://www.mediawiki.org/wiki/Special:Code/MediaWiki/$1\" title=\"revision $1 in SVN\">r$1</a>"; |
| 67 | + return $rev_link; |
69 | 68 | }; |
70 | 69 | |
71 | 70 | __PACKAGE__->NAME; |