From: lpsolit%gmail.com <> Date: Thu, 20 Apr 2006 04:47:25 +0000 (+0000) Subject: Bug 334617: importxml.pl crashes when importing bugs having attachments from version... X-Git-Tag: bugzilla-2.23.1~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9fef4d440062fb2a5080c1cf79f847dc587b5459;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 47f886c1c5..59bea430c3 100755 --- a/importxml.pl +++ b/importxml.pl @@ -397,7 +397,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