From: lpsolit%gmail.com <> Date: Thu, 20 Apr 2006 05:04:06 +0000 (+0000) Subject: Bug 334617: importxml.pl crashes when importing bugs having attachments from version... X-Git-Tag: bugzilla-2.22~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbac514ad754aad8b05475c3106023664171ea0c;p=thirdparty%2Fbugzilla.git Bug 334617: importxml.pl crashes when importing bugs having attachments from version 2.20 or older - Patch by Frédéric Buclin r=ghendricks a=myk --- diff --git a/importxml.pl b/importxml.pl index e3a1169216..2beb759278 100755 --- a/importxml.pl +++ b/importxml.pl @@ -398,7 +398,9 @@ sub process_attachment() { $attachment{'isobsolete'} = $attach->{'att'}->{'isobsolete'} || 0; $attachment{'isprivate'} = $attach->{'att'}->{'isprivate'} || 0; $attachment{'filename'} = $attach->field('filename') || "file"; - if ( defined( $attach->first_child('data')->{'att'}->{'encoding'} ) + # Attachment data is not exported in versions 2.20 and older. + if (defined $attach->first_child('data') + && defined $attach->first_child('data')->{'att'}->{'encoding'} && $attach->first_child('data')->{'att'}->{'encoding'} =~ /base64/ ) { # decode the base64