I’m migrating some WP data from one install to another for a client, using WordPress Export/Import. I export a WXR file from one WP instance, import it in another. Both instances are identical — same servers, same code version.
Most of my client’s posts contain DOS line endings — CRLF, aka \r\n, aka ^M^J – in the post_content, and also in serialized strings in postmeta.
These DOS line endings appear in the WXR file as raw control characters. They’re not XML-escaped or processed in any other way, which seems fishy. And when this WXR file is parsed by the importer, those carriage returns are stripped out. This subtly alters the post_content, but it wreaks havoc with the serialized postmeta data, which refuses to import.
Before I report this as a bug, I want to make sure that my client’s not doing something wrong with their custom code. Is it considered illegal or “impossible” to have CR characters in the WordPress database? Are they filtered out somewhere in the wp_insert_post process?
Thanks for any insight,
- The topic ‘WP can't export/import DOS line endings … are they illegal in posts?’ is closed to new replies.