]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 647662 - Add a "size" return value to Bug.attachments
authorReed Loden <reed@reedloden.com>
Fri, 30 Dec 2011 23:31:19 +0000 (15:31 -0800)
committerReed Loden <reed@reedloden.com>
Fri, 30 Dec 2011 23:31:19 +0000 (15:31 -0800)
[r=dkl r=mkanat a=mkanat]

Bugzilla/Attachment.pm
Bugzilla/WebService/Bug.pm

index 5c56d6e98ddd0c9290daf88169edfef20405aaee..d91e17b93029073753677a881ca7cb039847248f 100644 (file)
@@ -373,7 +373,7 @@ sub data {
 
 =item C<datasize>
 
-the length (in characters) of the attachment content
+the length (in bytes) of the attachment content
 
 =back
 
index 9a67f230483db6f1a74d47fb252f683be9da0595..415681678fb3f573c4338d368abf4d4bc0b5fde9 100644 (file)
@@ -933,6 +933,10 @@ sub _attachment_to_hash {
         $item->{'data'} = $self->type('base64', $attach->data);
     }
 
+    if (filter_wants $filters, 'size') {
+        $item->{'size'} = $self->type('int', $attach->datasize);
+    }
+
     return $item;
 }
 
@@ -1286,6 +1290,10 @@ diagram above) are:
 
 C<base64> The raw data of the attachment, encoded as Base64.
 
+=item C<size>
+
+C<int> The length (in bytes) of the attachment.
+
 =item C<creation_time>
 
 C<dateTime> The time the attachment was created.
@@ -1373,6 +1381,8 @@ C<summary>.
 =item In Bugzilla B<4.2>, the C<is_url> return value was removed
 (this attribute no longer exists for attachments).
 
+=item The C<size> return value was added in Bugzilla B<5.0>.
+
 =back
 
 =back