News:

Wondering if this will always be free?  See why free is better.

Main Menu

XMB-to-SMF converter leaves backslashes

Started by Misanthrope, December 09, 2004, 08:11:04 PM

Previous topic - Next topic

Misanthrope

I just converted my old XMB 1.9 forum over to SMF, and the only problem I have is that all of the apostrophes and quotes in the posts/threads on the converted SMF install are now escaped with backslashes.

*HOW* do I get rid of those?

-Misanthrope

[Unknown]

Have you had any new posts yet?

Is it both " and '?  I assume \ also would be escaped - anything else?  Are most bbc tags working properly?

I'm afraid the XMB converter hasn't had as much testing as we'd like, but I wasn't aware of this issue.  I wonder if it's only 1.9, but I expect it's probably not.

-[Unknown]

Misanthrope

Yes, apostrophes and quotes were escaped.

The way XMB works, it stripslashes everything it pulls from the database before displaying it, and when I look inside the XMB database I see backslashes all over the place. So XMB aparently adds slashes somewhere in the process of putting information into the database, and I think that's what's confusing your converter's output.

So the converter should strip the slashes out of the data pulled from the XMB database before sticking it in the SMF database. I think this would fix the conversion problem. I'd do it, but my PHP mastery isn't quite up to the level I'd like it to be.

-Misanthrope

Peter Duggan

#3
Quote from: Misanthrope on December 10, 2004, 02:30:47 AM
So XMB aparently adds slashes somewhere in the process of putting information into the database

So does all properly-written software (including SMF).

<edit>At least I thought it did, but it looks like it's giving us &#039; and &quot; instead now.</edit>

Misanthrope

Without checking to see if the database input is already escaped? In a lot of places I'm seeing multiple backslashes, and this is what I\\\\\'m talking about.

-Misanthrope

Misanthrope

Incidentally, I'm something of a total amateur with PHP/MySQL, so bear with me if I sound like an idiot...it's just that my forum is for a commercial website, and I can't really just flush all the posts and start over. I'd really like to get rid of XMB once and for all, and SMF seems to be one of the very few decent forum packages that has a converter for XMB.

-Misanthrope


[Unknown]

#6
I'll try to get to it this week (meaning next couple days) and attach the updated converter.  The thing is, if you put this into the database:

'don\'t'

It will store the word "don't", without the slash.  You add the slash to make sure it knows not to end the ' you started.  What XMB is apparently doing is this:

'don\\\'t'

Which is adding the extra slash in the actual data *stored*.  This is, imho, strange behavior... but whatever.

As for SMF, to avoid some complication caused by using preg_replace with the e flag (glow, shadow, etc.), slashes are avoided in the message body.

Incidentally... while I'm looking at it... were there any other problems at all you encountered?  Edit: Nevermind, it was simpler to fix than I thought it might be, after double checking an XMB install.

-[Unknown]

Misanthrope

Wow, that was fast...

Yeah, I expected the conversion to go better than it did because of what you described, that "don\'t" goes into the database as "don't". That's how I thought it would work, and that's why I figured the problem was caused by XMB rather than being a general PHP/MySQL issue.

I'm gonna give the new converter a try and let you know how it worked out.

-Misanthrope

_complex

In fact, my forum did this to me too.

I just always delete them, when i go and change my permissions.

but did find this problem a little werid... :|

Onsite

#9
I just did a conversion using the new converter, from XMB v1.9 Nexus (alpha 7), and the only backslashes left were in the forum and post titles.

On another note all the U2U messages were lost. Not the end of the world, but it would be nice to be able to convert them as well.

[Unknown]

So everything is backslashed like that.  I see.

-[Unknown]

[Unknown]

 ! XMB converter was adding slashes in bad/annoying places. (xmb_to_smf.php)

-[Unknown]

_complex

So unknown have the errors been fixed?.. or?

Kirby


[Unknown]

Legend:
--------------------------------------------------------------------------------
! Minor change or bugfix. (don't bother to log typos except between releases.)
* Change like above, but affects templates.
& Change that affects a language file. (make two if it affects templates too.)
+ Feature addition or improvement.
- Feature or option removal.
% Development flag or note, such as branching.


-[Unknown]

Onsite

#15
Ok, the converter does import the u2u messages into the database, but they are not viewable.
Sending new ones work fine, but none of the converted ones can be seen.
Apparently they are not being placed into the smf_im_recipients table.

Any ideas on how to add this to the converter, or running a sql query to import them into it??

[Unknown]

Is the im_recipients table totally empty?  You can check with phpMyAdmin... What is phpMyAdmin?

-[Unknown]

Onsite

Quote from: [Unknown] on December 20, 2004, 05:42:19 PM
Is the im_recipients table totally empty?  You can check with phpMyAdmin... What is phpMyAdmin?

Yes, except for the couple of new test IMs it is totally empty.
That's how I figured out that was the problem.

Onsite

Any luck on finding a fix for this script yet?

[Unknown]

Can you tell me if this helps at all?  Any error messages at all?

-[Unknown]

Advertisement: