This is an edge-case problem but none-the-less one that we ran into recently.
If you have a string that contains escaped single quotes, those single quotes become un-escaped upon import.
For example, create a new story node with the following body:
A story with \' \" \\
Then import it at admin/content/node. The resulting body is now:
A story with ' \" \
So as you can see, we loose the "escaping" on single quotes and backslashes. It's not really escaping within the node body of course, but we have had unintentional data modification.
This patch replaces the use of addslashes() with strtr() and only escapes the only character that matters: a single quote. It also makes it so we don't have to do any string correction on import at all, which is a nice bonus.
Comment | File | Size | Author |
---|---|---|---|
node_export_slashes.patch | 748 bytes | quicksketch |
Comments
Comment #1
danielb CreditAttribution: danielb commentedThank you.
Comment #2
quicksketchShoot, sorry there were two typos in that comment:
Should be:
Comment #3
danielb CreditAttribution: danielb commentedkk
Committed
Comment #4
quicksketchThanks, danielb! Much appreciated.
Comment #6
safetypinI just performed exports and imports and have found that double quotes are still being escaped in export, and not unescaped on import. I was exporting/importing the data as a file download/upload. Does that make a difference?
Comment #7
danielb CreditAttribution: danielb commentedI don't know what to do about this then. It's worked for me no matter how it was implemented. Could be magic quotes or some garbage?
Comment #8
danielb CreditAttribution: danielb commentedSorry, I can't replicate double quotes being escaped in a file download. This issue was fixed, if you can find out more info about your situation, especially how to replicate it, please start a new issue. It is possible the problem you're having has to do with PHP configuration? I'm not really sure.