Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
e0f4e652
Commit
e0f4e652
authored
Feb 06, 2007
by
ghendricks%novell.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
patch by Guzmán Brasó
r=ghendricks, a=LpSolit
parent
e4ec2589
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
importxml.pl
importxml.pl
+16
-10
No files found.
importxml.pl
View file @
e0f4e652
...
...
@@ -1178,16 +1178,22 @@ Debug( "Reading xml", DEBUG_LEVEL );
local
(
$/
);
$xml
=
<>
;
# If the email was encoded (Mailer::MessageToMTA() does it when using UTF-8),
# we have to decode it first, else the XML parsing will fail.
my
$parser
=
MIME::
Parser
->
new
;
$parser
->
output_to_core
(
1
);
$parser
->
tmp_to_core
(
1
);
my
$entity
=
$parser
->
parse_data
(
$xml
);
my
$bodyhandle
=
$entity
->
bodyhandle
;
$xml
=
$bodyhandle
->
as_string
;
# remove everything in file before xml header (i.e. remove the mail header)
# If there's anything except whitespace before <?xml then we guess it's a mail
# and MIME::Parser should parse it. Else don't.
if
(
$xml
=~
m/\S.*<\?xml/s
)
{
# If the email was encoded (Mailer::MessageToMTA() does it when using UTF-8),
# we have to decode it first, else the XML parsing will fail.
my
$parser
=
MIME::
Parser
->
new
;
$parser
->
output_to_core
(
1
);
$parser
->
tmp_to_core
(
1
);
my
$entity
=
$parser
->
parse_data
(
$xml
);
my
$bodyhandle
=
$entity
->
bodyhandle
;
$xml
=
$bodyhandle
->
as_string
;
}
# remove everything in file before xml header
$xml
=~
s/^.+(<\?xml version.+)$/$1/s
;
Debug
(
"Parsing tree"
,
DEBUG_LEVEL
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment