Skip to content

Commit 9365f5f

Browse files
author
David Lawrence
committed
Bug 1009215 - add support for support.mozilla.org links to see_also
r=glob
1 parent 3f35dd0 commit 9365f5f

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

Bugzilla/BugUrl.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ use constant SUB_CLASSES => qw(
7070
Bugzilla::BugUrl::MantisBT
7171
Bugzilla::BugUrl::SourceForge
7272
Bugzilla::BugUrl::GitHub
73+
Bugzilla::BugUrl::MozSupport
7374
);
7475

7576
###############################

Bugzilla/BugUrl/MozSupport.pm

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
#
5+
# This Source Code Form is "Incompatible With Secondary Licenses", as
6+
# defined by the Mozilla Public License, v. 2.0.
7+
8+
package Bugzilla::BugUrl::MozSupport;
9+
use strict;
10+
use base qw(Bugzilla::BugUrl);
11+
12+
###############################
13+
#### Methods ####
14+
###############################
15+
16+
sub should_handle {
17+
my ($class, $uri) = @_;
18+
19+
# Mozilla support questions normally have the form:
20+
# https://support.mozilla.org/<language>/questions/<id>
21+
return ($uri->authority =~ /^support.mozilla.org$/i
22+
and $uri->path =~ m|^(/[^/]+)?/questions/\d+$|) ? 1 : 0;
23+
}
24+
25+
sub _check_value {
26+
my ($class, $uri) = @_;
27+
28+
$uri = $class->SUPER::_check_value($uri);
29+
30+
# Support.mozilla.org redirects to https automatically
31+
$uri->scheme('https');
32+
33+
return $uri;
34+
}
35+
36+
1;

template/en/default/global/user-error.html.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@
275275
<li>A b[% %]ug in a MantisBT installation.</li>
276276
<li>A b[% %]ug on sourceforge.net.</li>
277277
<li>An issue on github.com.</li>
278+
<li>A question on support.mozilla.org</li>
278279
</ul>
279280
[% ELSIF reason == 'id' %]
280281
There is no valid [% terms.bug %] id in that URL.

0 commit comments

Comments
 (0)