]> 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:06:16 +0000 (15:06 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Tue, 5 Jan 2016 14:06:16 +0000 (15:06 +0100)
r=LpSolit a=dkl

Bugzilla/Attachment.pm

index 932fb6b178ed70bd5f37969f23fa4b5b546bfde8..33183797ba276f7dd260a4382ee1a1e2b60cd40d 100644 (file)
@@ -865,6 +865,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);
@@ -872,7 +874,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;
 }