summaryrefslogtreecommitdiffstats
path: root/extensions/BzAPI
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/BzAPI')
-rw-r--r--extensions/BzAPI/lib/Util.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/extensions/BzAPI/lib/Util.pm b/extensions/BzAPI/lib/Util.pm
index 2cbb078b8..c68592f70 100644
--- a/extensions/BzAPI/lib/Util.pm
+++ b/extensions/BzAPI/lib/Util.pm
@@ -328,8 +328,16 @@ sub fix_attachment {
}
}
- if ($data->{data}) {
+ if (exists $data->{data}) {
$data->{encoding} = $rpc->type('string', 'base64');
+ if ($params->{attachmentdata}
+ || filter_wants_nocache($params, 'attachments.data'))
+ {
+ $data->{encoding} = $rpc->type('string', 'base64');
+ }
+ else {
+ delete $data->{data};
+ }
}
if (exists $data->{bug_id}) {