bobbingwide / oik-clone

Clone content between sites
https://www.oik-plugins.com/oik-plugins/oik-clone-clone-your-wordpress-content/
GNU General Public License v2.0
5 stars 0 forks source link

Backslashes not cloned correctly #22

Closed bobbingwide closed 5 years ago

bobbingwide commented 6 years ago

Content containing backslashes has lost them in the cloned post.

Expected output

Post content such as backslashes to be the same on the target as on the server.

Unpack to a new directory C:\php72

Actual output

Unpack to a new directory C:php72

I should have taken a screen capture. See https://herbmiller.me/2017/12/06/migrating-php-7-2/

It appears that the problem only happens on post creation. In subsequent cloning, where I'd converted one of them to \ I can see all the backslashes. We can see all the changes in the Revisions.

Workaround

Clone the content multiple times.

Problem explanation

TBD

Proposed solution

TBD

bobbingwide commented 6 years ago

Looking at another cloned post, it would appear that greater than signs may suffer a similar indignity. This needs to be confirmed.

bobbingwide commented 5 years ago

This issue affects the cloning of content created using Gutenberg. The CSV block contains new line characters ( \n ) which are converted to just the n's. See most recent oik_pluginversions in s.b/oikcom

bobbingwide commented 5 years ago

Seems I already knew the workaround when I raised this issue exactly one year before rediscovering it yesterday!

bobbingwide commented 5 years ago

The fix is to call wp_slash before wp_insert_post. Just like it's done in the update!