summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-04-20 06:47:25 +0200
committerlpsolit%gmail.com <>2006-04-20 06:47:25 +0200
commit9fef4d440062fb2a5080c1cf79f847dc587b5459 (patch)
treefbe18fb46f757e3e8f7a180e106e85854199d17d
parent794419cacad6de57a10228a4f839a4ed5c44d9ed (diff)
downloadbugzilla-9fef4d440062fb2a5080c1cf79f847dc587b5459.tar.gz
bugzilla-9fef4d440062fb2a5080c1cf79f847dc587b5459.tar.xz
Bug 334617: importxml.pl crashes when importing bugs having attachments from version 2.20 or older - Patch by Frédéric Buclin <LpSolit@gmail.com> r=ghendricks a=myk
-rwxr-xr-ximportxml.pl4
1 files changed, 3 insertions, 1 deletions
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