Title: [200457] trunk/Websites/bugs.webkit.org
Revision
200457
Author
[email protected]
Date
2016-05-05 09:49:04 -0700 (Thu, 05 May 2016)

Log Message

bugs.webkit.org: "See Also" field should support Chromium bugs

Merge Bugzilla upstream master 3af55bfe0bd10a85b7cd69e26a19034a6d2e78f5.
<https://bugzilla.mozilla.org/show_bug.cgi?id=1252782>

* Bugzilla/BugUrl.pm: Add Bugzilla::BugUrl::Chromium class to
list of classes that parse supported URLs.
* Bugzilla/BugUrl/Chromium.pm: Added.
(should_handle):
(_check_value):
* template/en/default/global/user-error.html.tmpl: Update error
message.

Modified Paths

Added Paths

Diff

Added: trunk/Websites/bugs.webkit.org/Bugzilla/BugUrl/Chromium.pm (0 => 200457)


--- trunk/Websites/bugs.webkit.org/Bugzilla/BugUrl/Chromium.pm	                        (rev 0)
+++ trunk/Websites/bugs.webkit.org/Bugzilla/BugUrl/Chromium.pm	2016-05-05 16:49:04 UTC (rev 200457)
@@ -0,0 +1,49 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This Source Code Form is "Incompatible With Secondary Licenses", as
+# defined by the Mozilla Public License, v. 2.0.
+
+package Bugzilla::BugUrl::Chromium;
+
+use 5.10.1;
+use strict;
+use warnings;
+
+use base qw(Bugzilla::BugUrl);
+
+use Bugzilla::Error;
+use Bugzilla::Util;
+
+###############################
+####        Methods        ####
+###############################
+
+sub should_handle {
+    my ($class, $uri) = @_;
+    return ($uri->authority =~ /^bugs.chromium.org$/i) ? 1 : 0;
+}
+
+sub _check_value {
+    my ($class, $uri) = @_;
+
+    $uri = $class->SUPER::_check_value($uri);
+
+    my $value = $uri->as_string;
+    my $project_name;
+    if ($uri->path =~ m|^/p/([^/]+)/issues/detail$|) {
+        $project_name = $1;
+    } else {
+        ThrowUserError('bug_url_invalid', { url ="" $value });
+    }
+    my $bug_id = $uri->query_param('id');
+    detaint_natural($bug_id);
+    if (!$bug_id) {
+        ThrowUserError('bug_url_invalid', { url ="" $value, reason => 'id' });
+    }
+
+    return URI->new($value);
+}
+
+1;

Modified: trunk/Websites/bugs.webkit.org/Bugzilla/BugUrl.pm (200456 => 200457)


--- trunk/Websites/bugs.webkit.org/Bugzilla/BugUrl.pm	2016-05-05 15:31:16 UTC (rev 200456)
+++ trunk/Websites/bugs.webkit.org/Bugzilla/BugUrl.pm	2016-05-05 16:49:04 UTC (rev 200457)
@@ -64,6 +64,7 @@
     Bugzilla::BugUrl::Bugzilla
     Bugzilla::BugUrl::Launchpad
     Bugzilla::BugUrl::Google
+    Bugzilla::BugUrl::Chromium
     Bugzilla::BugUrl::Debian
     Bugzilla::BugUrl::JIRA
     Bugzilla::BugUrl::Trac

Modified: trunk/Websites/bugs.webkit.org/ChangeLog (200456 => 200457)


--- trunk/Websites/bugs.webkit.org/ChangeLog	2016-05-05 15:31:16 UTC (rev 200456)
+++ trunk/Websites/bugs.webkit.org/ChangeLog	2016-05-05 16:49:04 UTC (rev 200457)
@@ -1,3 +1,18 @@
+2016-05-05  David Kilzer  <[email protected]>
+
+        bugs.webkit.org: "See Also" field should support Chromium bugs
+
+        Merge Bugzilla upstream master 3af55bfe0bd10a85b7cd69e26a19034a6d2e78f5.
+        <https://bugzilla.mozilla.org/show_bug.cgi?id=1252782>
+
+        * Bugzilla/BugUrl.pm: Add Bugzilla::BugUrl::Chromium class to
+        list of classes that parse supported URLs.
+        * Bugzilla/BugUrl/Chromium.pm: Added.
+        (should_handle):
+        (_check_value):
+        * template/en/default/global/user-error.html.tmpl: Update error
+        message.
+
 2015-12-09  Daniel Bates  <[email protected]>
 
         REGRESSION: code-review-tests.html fails with error "Received an error at line 214"

Modified: trunk/Websites/bugs.webkit.org/template/en/default/global/user-error.html.tmpl (200456 => 200457)


--- trunk/Websites/bugs.webkit.org/template/en/default/global/user-error.html.tmpl	2016-05-05 15:31:16 UTC (rev 200456)
+++ trunk/Websites/bugs.webkit.org/template/en/default/global/user-error.html.tmpl	2016-05-05 16:49:04 UTC (rev 200457)
@@ -265,6 +265,7 @@
           installation.</li>
         <li>A b[% %]ug on launchpad.net</li>
         <li>An issue on code.google.com.</li>
+        <li>An issue on b[% %]ugs.chromium.org.</li>
         <li>A b[% %]ug on b[% %]ugs.debian.org.</li>
         <li>An issue in a JIRA installation.</li>
         <li>A ticket in a Trac installation.</li>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to