Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/bestpractical/rt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorsunnavy <sunnavy@bestpractical.com>2022-09-03 01:12:06 +0300
committersunnavy <sunnavy@bestpractical.com>2022-09-03 01:12:06 +0300
commit7e0ee709551c1c8d8be0e9895c007a795384d3d8 (patch)
treeee2a5bf352140667bbf247beff9c496678e00983 /lib
parentd32618f376b059f3442bb689acbda86cc1e2a8fa (diff)
parent434a45c7a14873280474e75627b6e60755e912c5 (diff)
Merge branch '4.4-trunk' into 5.0-trunk
Diffstat (limited to 'lib')
-rw-r--r--lib/RT/Attachment.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/RT/Attachment.pm b/lib/RT/Attachment.pm
index b0b2fc66cc..8b6dc5ea0f 100644
--- a/lib/RT/Attachment.pm
+++ b/lib/RT/Attachment.pm
@@ -376,8 +376,14 @@ sub OriginalContent {
if ($self->IsMessageContentType) {
# There shouldn't be more than one "subpart" to a message/* attachment
my $child = $self->Children->First;
- return $self->Content unless $child and $child->id;
- return $child->ContentAsMIME(Children => 1)->as_string;
+ if ( $child and $child->id ) {
+ return $child->ContentAsMIME( Children => 1 )->as_string;
+ }
+ else {
+ # No children could happen if $TreatAttachedEmailAsFiles is true.
+ # Can't indiscriminately return $self->Content as it might be decoded(for textual messages).
+ # Leave it to the follwing code, which covers this case.
+ }
}
return $self->Content unless RT::I18N::IsTextualContentType($self->ContentType);