From: Mahdi Mokhtari Date: Tue, 5 Jan 2016 14:06:16 +0000 (+0100) Subject: Bug 1235270: Set submitter_id before calling _check_data() X-Git-Tag: release-5.0.3~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6e6093a1ea2e44df70c1689e454a24c71cc33e54;p=thirdparty%2Fbugzilla.git Bug 1235270: Set submitter_id before calling _check_data() r=LpSolit a=dkl --- diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm index 932fb6b178..33183797ba 100644 --- a/Bugzilla/Attachment.pm +++ b/Bugzilla/Attachment.pm @@ -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; }