Commit b7777aee authored by Max Kanat-Alexander's avatar Max Kanat-Alexander

Bug 593170: Disallow urls like "show_bug.cgi?id=2323" (with no domain) in

the See Also field. r=timello, a=mkanat
parent f5474782
......@@ -2815,6 +2815,15 @@ sub add_see_also {
ThrowUserError('bug_url_invalid', { url => $input, reason => 'http' });
}
# This stops the following edge cases from being accepted:
# * show_bug.cgi?id=1
# * /show_bug.cgi?id=1
# * http:///show_bug.cgi?id=1
if (!$uri->authority or $uri->path !~ m{/}) {
ThrowUserError('bug_url_invalid',
{ url => $input, reason => 'path_only' });
}
my $result;
# Launchpad URLs
if ($uri->authority =~ /launchpad.net$/) {
......
......@@ -245,6 +245,8 @@
<code>[% url FILTER html %]</code> is not a valid URL to [% terms.abug %].
[% IF reason == 'http' %]
URLs must start with "http" or "https".
[% ELSIF reason == 'path_only' %]
You must specify a full URL.
[% ELSIF reason == 'show_bug' %]
[%+ field_descs.see_also %] URLs should point to one of:
<ul>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment