]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1436619 - followup: ignore "http://" in URL field
authorDylan William Hardison <dylan@hardison.net>
Thu, 8 Nov 2018 15:17:37 +0000 (10:17 -0500)
committerGitHub <noreply@github.com>
Thu, 8 Nov 2018 15:17:37 +0000 (10:17 -0500)
Bugzilla/Bug.pm

index 2cebacbb82e2d20f10f894a2bea0be5942371d57..ee48ed7a2b030840688a6b6a3bee3cde9e8beb9a 100644 (file)
@@ -1678,8 +1678,12 @@ sub _check_assigned_to {
 sub _check_bug_file_loc {
     my ($invocant, $url) = @_;
     $url = '' if !defined($url);
-    # TODO: Add validation. It has to be loose, since we have accepted `data:`,
-    # `javascript:` and any other values on the URL field.
+    # On bug entry, if bug_file_loc is "http://", the default, use an
+    # empty value instead. However, on bug editing people can set that
+    # back if they *really* want to.
+    if (!ref $invocant && $url eq 'http://') {
+        $url = '';
+    }
     return $url;
 }