Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #22279


Ignore:
Timestamp:
02/22/2014 09:40:42 AM (11 years ago)
Author:
ocean90
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #22279

    • Property Summary changed from Wordpress Export/Import deletes carriage returns to WordPress Export/Import deletes carriage returns
  • Ticket #22279 – Description

    initial v1  
    1 Wordpress export does not translate or escape bare CR characters in a CR/LF pair.  They show up unfiltered in the WXR export file.  I see this both in post_content and in strings that were serialized into a post_meta field.  The CR characters are in the WXR file, unfiltered.
     1WordPress export does not translate or escape bare CR characters in a CR/LF pair.  They show up unfiltered in the WXR export file.  I see this both in post_content and in strings that were serialized into a post_meta field.  The CR characters are in the WXR file, unfiltered.
    22
    3 Then, Wordpress import loses these CR characters.  They are simply erased.  It may be because SimpleXMLParser can't or won't open the XML file in binary mode, so line ending translation can & does happen.  That's just a theory, but if it's true then this behavior might *not* happen on all platforms or with all PHP versions.  (I'm seeing this on OS X 10.6.8, PHP 5.4.4.)
     3Then, WordPress import loses these CR characters.  They are simply erased.  It may be because SimpleXMLParser can't or won't open the XML file in binary mode, so line ending translation can & does happen.  That's just a theory, but if it's true then this behavior might *not* happen on all platforms or with all PHP versions.  (I'm seeing this on OS X 10.6.8, PHP 5.4.4.)
    44
    55In the worse case -- mine -- the munged string is a small component of a complex datastructure that is serialized in a postmeta record.  In this case, the entire meta_value field is deleted on import, because the data won't unserialize, because its length has changed.
     
    1111* store a carriage return in a post. 
    1212* export it to a WXR file.
    13 * examine the WXR file for the raw carriage return (^M).
     13* examine the WXR file for the raw carriage return (`^M`).
    1414* import that file.
    1515* search for the carriage return.