Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2010-10-22 19:34:06
- vurt
- Member
- Registered: 2010-10-22
- Posts: 50
Importing from Wordpress leaves backslashes in comments.
Hello.
I’ve managed to import a Wordpress blog into txp 4.2.0, but all of the comments now have backslashes before apostrophes and quotation marks.
Anybody have any idea how to strip them, without doing it individually?
Any idea why it just happened to the comments?
Thank you!
Offline
#2 2010-10-22 20:33:03
- RalphFFM
- Member
- Registered: 2008-10-05
- Posts: 40
Re: Importing from Wordpress leaves backslashes in comments.
Untested: http://textpattern.org/plugins/914/lam_search_replace
But it seems that it’s no more working(?)
Offline
#3 2010-10-22 20:42:57
- vurt
- Member
- Registered: 2010-10-22
- Posts: 50
Re: Importing from Wordpress leaves backslashes in comments.
As long as I make sure there’s no harmful code in the comments, I could use a solution like this, or do a replace in the table. I’m just wondering why the importer didn’t add the backslashes to the posts, only to the comments.
Is it a function of the importer to check the code for escaped characters?
If it matters, I’m testing this locally with XAMPP (both CMSs are local).
Offline
#4 2010-10-23 10:58:23
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: Importing from Wordpress leaves backslashes in comments.
vurt wrote:
… I’m just wondering why the importer didn’t add the backslashes to the posts, only to the comments.
Posts are usually under control of one of the site authors — they are unlikely to intentionally include malicious content. The same cannot be said for folks (or robots) that comment on blogs.
— Steve
Offline
#5 2010-10-25 14:09:41
- vurt
- Member
- Registered: 2010-10-22
- Posts: 50
Re: Importing from Wordpress leaves backslashes in comments.
Here’s my solution:
<txp:if_comments_preview>
<txp:comment_message />
<txp:else />
<txp:php>
$a = comment_message (array ());
echo stripslashes($a);
</txp:php>
</txp:if_comments_preview>
I made sure to conditionally not put it in the comment preview.
Anyone see any problems with this?
Offline