From 9fef4d440062fb2a5080c1cf79f847dc587b5459 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Thu, 20 Apr 2006 04:47:25 +0000 Subject: 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- importxml.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'importxml.pl') diff --git a/importxml.pl b/importxml.pl index 47f886c1c..59bea430c 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 -- cgit v1.2.3-24-g4f1b