]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 721715: URLs in the See Also field must be detainted before inserted into the DB
authorFrédéric Buclin <LpSolit@gmail.com>
Fri, 27 Jan 2012 21:26:28 +0000 (22:26 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Fri, 27 Jan 2012 21:26:28 +0000 (22:26 +0100)
r=dkl a=LpSolit

Bugzilla/Bug.pm

index aeb2e16b72c2549fe321c156ad345262f22c491e..4a00596b058bd17dd05270fad21b71659067f7b9 100644 (file)
@@ -2822,14 +2822,13 @@ sub add_see_also {
     $class->check_required_create_fields($params);
 
     my $field_values = $class->run_create_validators($params);
-    $uri = $field_values->{value};
-    $field_values->{value} = $uri->as_string;
+    my $value = $field_values->{value}->as_string;
+    trick_taint($value);
+    $field_values->{value} = $value;
 
     # We only add the new URI if it hasn't been added yet. URIs are
     # case-sensitive, but most of our DBs are case-insensitive, so we do
     # this check case-insensitively.
-    my $value = $uri->as_string;
-
     if (!grep { lc($_->name) eq lc($value) } @{ $self->see_also }) {
         my $privs;
         my $can = $self->check_can_change_field('see_also', '', $value, \$privs);