Skip to content

Warning: Undefined array key 1 in /var/mywebsite/public/wp-content/plugins/wordpress-importer/parsers/class-wxr-parser-regex.php on line 64 #118

Open

Description

@BackuPs

I am getting this warning message.
Warning: Undefined array key 1 in /var/mywebsite/public/wp-content/plugins/wordpress-importer/parsers/class-wxr-parser-regex.php on line 64

Activity

  1. dd32 commented on Oct 12, 2022

    @dd32
    Member

    Looking at the code responsible here:
    https://github.com/WordPress/wordpress-importer/blob/master/src/parsers/class-wxr-parser-regex.php#L63-L68

    The PHP Warning is suggesting that the line contains <wp:author> but that <wp:author>...</wp:author> is not present on the line being parsed. The regex includes s to include new lines in the middle of the tags, but this parser only parses line-by-line..

    I suspect this can be triggered by having an author with a \n in a user field, OR where the author tags exceed 8192 chars, as there's a lot of tags within that tag:
    https://github.com/WordPress/wordpress-importer/blob/master/src/parsers/class-wxr-parser-regex.php#L210-L217

    I guess a fix here is to move the author handling into $multiline_tags, but with the note that $this->{$handler[0]}[] = ... and $this->authors[ $a['author_login'] ] = ... are incompatible right now, so some changes to set a specific key out of the payload would be required.

  2. Ruchika-01 commented on Feb 27, 2026

    @Ruchika-01

    Closing this PR for now. I’ll revisit after addressing CI issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions