Skip to content

bug in WXR_Parser_Regex when parsing authors #144

@pbiron

Description

@pbiron

The regex parser assumes that author info is all contained on a single line, when in practice the WP exporter outputs authors across multiple lines in the WXR.

For example, the exporter outputs

 <wp:author>
   <wp:author_id>7</wp:author_id>
   <wp:author_login>username</wp:author_login>
   <wp:author_email>user@example.com</wp:author_email>
   <wp:author_display_name><![CDATA[First Last]]></wp:author_display_name>
   <wp:author_first_name><![CDATA[First]]></wp:author_first_name>
   <wp:author_last_name><![CDATA[Last]]></wp:author_last_name>
 </wp:author>

whereas, the regex parser is expecting

<wp:author><wp:author_id>7</wp:author_id><wp:author_login>username</wp:author_login><wp:author_email>user@example.com</wp:author_email><wp:author_display_name><![CDATA[First Last]]></wp:author_display_name><wp:author_first_name><![CDATA[First]]></wp:author_first_name><wp:author_last_name><![CDATA[Last]]></wp:author_last_name></wp:author>

I've got a tentative fix, but need to test it some more before submitting a PR (which probably won't be until the weekend)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions