Commit a25730da authored by Reed Loden's avatar Reed Loden

Bug 647662 - Add a "size" return value to Bug.attachments

[r=dkl r=mkanat a=mkanat]
parent 21d5f6e1
...@@ -373,7 +373,7 @@ sub data { ...@@ -373,7 +373,7 @@ sub data {
=item C<datasize> =item C<datasize>
the length (in characters) of the attachment content the length (in bytes) of the attachment content
=back =back
......
...@@ -933,6 +933,10 @@ sub _attachment_to_hash { ...@@ -933,6 +933,10 @@ sub _attachment_to_hash {
$item->{'data'} = $self->type('base64', $attach->data); $item->{'data'} = $self->type('base64', $attach->data);
} }
if (filter_wants $filters, 'size') {
$item->{'size'} = $self->type('int', $attach->datasize);
}
return $item; return $item;
} }
...@@ -1286,6 +1290,10 @@ diagram above) are: ...@@ -1286,6 +1290,10 @@ diagram above) are:
C<base64> The raw data of the attachment, encoded as Base64. 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> =item C<creation_time>
C<dateTime> The time the attachment was created. C<dateTime> The time the attachment was created.
...@@ -1373,6 +1381,8 @@ C<summary>. ...@@ -1373,6 +1381,8 @@ C<summary>.
=item In Bugzilla B<4.2>, the C<is_url> return value was removed =item In Bugzilla B<4.2>, the C<is_url> return value was removed
(this attribute no longer exists for attachments). (this attribute no longer exists for attachments).
=item The C<size> return value was added in Bugzilla B<5.0>.
=back =back
=back =back
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment