Closed jjpmann closed 2 years ago
Hi @jjpmann, Thanks for the PR!
Looking at the change here, it seems reasonable, but can you expand upon the need for it / if there's a ticket explaining the bug somewhere?
Thanks!
Hi @dd32 ,
Sorry for missing the details. I created a ticket here but didn't exactly know the full process. https://core.trac.wordpress.org/ticket/53956
Basically, if the regex parse was used the blog_url would always get overridden unless it was the last parsed line in the loop.
Reviewing this closer..
SimpleXML has similar logic, but runs once prior to the parse, rather than each loop. https://github.com/WordPress/wordpress-importer/blob/master/src/parsers/class-wxr-parser-simplexml.php#L55-L63
XML Parser has similar logic, only setting once thanks to isset()
:
https://github.com/WordPress/wordpress-importer/blob/master/src/parsers/class-wxr-parser-xml.php#L240-L244
Change seems appropriate.
don't override base_blog_url if already set