Dzahn has submitted this change and it was merged.

Change subject: Sync custom repository with what's on Bugzilla production 
server already.
......................................................................


Sync custom repository with what's on Bugzilla production server already.

This time hopefully for real.

RT #8516

Change-Id: I0fbb98ecb973ad2e01bd6d3f834093d33d7afaca
---
M attachment.cgi
1 file changed, 6 insertions(+), 4 deletions(-)

Approvals:
  Dzahn: Verified; Looks good to me, approved



diff --git a/attachment.cgi b/attachment.cgi
index 769c47f..033c06d 100755
--- a/attachment.cgi
+++ b/attachment.cgi
@@ -205,8 +205,9 @@
 {
   my $context = $cgi->param('context') || "patch";
   if ($context ne "file" && $context ne "patch") {
-    detaint_natural($context)
-      || ThrowUserError("invalid_context", { context => $cgi->param('context') 
});
+      my $orig_context = $context;
+      detaint_natural($context)
+        || ThrowUserError("invalid_context", { context => $orig_context });
   }
 
   return $context;
@@ -534,13 +535,14 @@
 
     # Get the filehandle of the attachment.
     my $data_fh = $cgi->upload('data');
+    my $attach_text = $cgi->param('attach_text');
 
     my $attachment = Bugzilla::Attachment->create(
         {bug           => $bug,
          creation_ts   => $timestamp,
-         data          => scalar $cgi->param('attach_text') || $data_fh,
+         data          => $attach_text || $data_fh,
          description   => scalar $cgi->param('description'),
-         filename      => $cgi->param('attach_text') ? "file_$bugid.txt" : 
scalar $cgi->upload('data'),
+         filename      => $attach_text ? "file_$bugid.txt" : $data_fh,
          ispatch       => scalar $cgi->param('ispatch'),
          isprivate     => scalar $cgi->param('isprivate'),
          mimetype      => $content_type,

-- 
To view, visit https://gerrit.wikimedia.org/r/165107
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0fbb98ecb973ad2e01bd6d3f834093d33d7afaca
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/bugzilla/modifications
Gerrit-Branch: master
Gerrit-Owner: Aklapper <[email protected]>
Gerrit-Reviewer: Dzahn <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to