You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Warning: Undefined array key 1 in /var/mywebsite/public/wp-content/plugins/wordpress-importer/parsers/class-wxr-parser-regex.php on line 64 #118
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
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 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.
Activity
dd32 commentedon Oct 12, 2022
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 includessto 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
\nin a user field, OR where the author tags exceed8192chars, 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.Ruchika-01 commentedon Feb 27, 2026
Closing this PR for now. I’ll revisit after addressing CI issues.