Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
migrate_plus
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
migrate_plus
Commits
8b68f193
Commit
8b68f193
authored
7 years ago
by
Brian Osborne
Committed by
Mike Ryan
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2860788
by bkosborne: XML parser should clear XML error buffer before processing XML data
parent
586c6177
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Plugin/migrate_plus/data_parser/SimpleXml.php
+6
-0
6 additions, 0 deletions
src/Plugin/migrate_plus/data_parser/SimpleXml.php
src/Plugin/migrate_plus/data_parser/Xml.php
+7
-0
7 additions, 0 deletions
src/Plugin/migrate_plus/data_parser/Xml.php
with
13 additions
and
0 deletions
src/Plugin/migrate_plus/data_parser/SimpleXml.php
+
6
−
0
View file @
8b68f193
...
@@ -38,6 +38,12 @@ class SimpleXml extends DataParserPluginBase {
...
@@ -38,6 +38,12 @@ class SimpleXml extends DataParserPluginBase {
* {@inheritdoc}
* {@inheritdoc}
*/
*/
protected
function
openSourceUrl
(
$url
)
{
protected
function
openSourceUrl
(
$url
)
{
// Clear XML error buffer. Other Drupal code that executed during the
// migration may have polluted the error buffer and could create false
// positives in our error check below. We are only concerned with errors
// that occur from attempting to load the XML string into an object here.
libxml_clear_errors
();
$xml_data
=
$this
->
getDataFetcherPlugin
()
->
getResponseContent
(
$url
);
$xml_data
=
$this
->
getDataFetcherPlugin
()
->
getResponseContent
(
$url
);
$xml
=
simplexml_load_string
(
$xml_data
);
$xml
=
simplexml_load_string
(
$xml_data
);
$this
->
registerNamespaces
(
$xml
);
$this
->
registerNamespaces
(
$xml
);
...
...
This diff is collapsed.
Click to expand it.
src/Plugin/migrate_plus/data_parser/Xml.php
+
7
−
0
View file @
8b68f193
...
@@ -174,6 +174,13 @@ class Xml extends DataParserPluginBase {
...
@@ -174,6 +174,13 @@ class Xml extends DataParserPluginBase {
protected
function
openSourceUrl
(
$url
)
{
protected
function
openSourceUrl
(
$url
)
{
// (Re)open the provided URL.
// (Re)open the provided URL.
$this
->
reader
->
close
();
$this
->
reader
->
close
();
// Clear XML error buffer. Other Drupal code that executed during the
// migration may have polluted the error buffer and could create false
// positives in our error check below. We are only concerned with errors
// that occur from attempting to load the XML string into an object here.
libxml_clear_errors
();
return
$this
->
reader
->
open
(
$url
,
NULL
,
\LIBXML_NOWARNING
);
return
$this
->
reader
->
open
(
$url
,
NULL
,
\LIBXML_NOWARNING
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment