• 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.

    https://wordpress.org/plugins/wordpress-importer/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Justin Busa

    (@justinbusa)

    I’m open to submitting a patch for this but am new to that for wordpress.org plugins and not sure how to go about it. Any input would be greatly appreciated!

    Justin

    Thread Starter Justin Busa

    (@justinbusa)

    Bumpity bump bump! I’m happy to contribute a patch for this if someone will point me in the right direction. I’m not sure how to go about that yet. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WXR_Parser_Regex adds newlines to import data, breaking serialized post meta.’ is closed to new replies.