WXR_Parser_Regex adds newlines to import data, breaking serialized post meta.
-
Our plugin stores a fair amount of serialized data in post meta fields. When using the importer, the WXR_Parser_Regex parser loops through 8192 bytes of the import file at a time, appending a newline to the import data at the end of each loop. When a newline is inserted in the middle of our post meta, it breaks when the time comes to unserialize in the import process, leaving our users with a blank post meta field.
The offending code can be seen starting at line 459 of parsers.php…
if ( $in_post ) { $post .= $importline . "\n"; }
Is that newline necessary? I have verified that removing it solves the problem and imports the serialized data correctly.
I created a ticket for this since it seems like a bug.
- The topic ‘WXR_Parser_Regex adds newlines to import data, breaking serialized post meta.’ is closed to new replies.