]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1235270: Set submitter_id before calling _check_data()
authorMahdi Mokhtari <mokhi64@gmail.com>
Tue, 5 Jan 2016 14:04:39 +0000 (15:04 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Tue, 5 Jan 2016 14:04:39 +0000 (15:04 +0100)
r=LpSolit

Bugzilla/Attachment.pm

index ed43cbe94d307a671b180b4362b358f3f9f8f0c5..1f2bddda5184884f849d4f6c03d31c937bd77550 100644 (file)
@@ -903,6 +903,8 @@ sub create {
 sub run_create_validators {
     my ($class, $params) = @_;
 
+    $params->{submitter_id} = Bugzilla->user->id || ThrowUserError('invalid_user');
+
     # Let's validate the attachment content first as it may
     # alter some other attachment attributes.
     $params->{data} = $class->_check_data($params);
@@ -910,7 +912,6 @@ sub run_create_validators {
 
     $params->{creation_ts} ||= Bugzilla->dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)');
     $params->{modification_time} = $params->{creation_ts};
-    $params->{submitter_id} = Bugzilla->user->id || ThrowUserError('invalid_user');
 
     return $params;
 }