MyBB Community Forums

Full Version: [punbb] Possible Apostrophe(quote) in username bug
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I seem to be having a problem with the merge system. I'm currently in the processing of moving a mixture of boards including SMF & punBB over to myBB, things are going spendidly on SMF and I'm about 75% complete on my second 400K post board conversion.

However some problems have cropped up on the merge from the punbb board.

From what I can make out it seems to be an issue with quotes (or apostrophes) in peoples usernames

Everything goes swimmingly until I get through to the convert threads section

Then I get the following error

Quote:Inserting thread #58... MySQLi error: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Houlihan' LIMIT 1' at line 1
Query: SELECT id, username FROM forums_users WHERE username = 'Patches O'Houlihan' LIMIT 1

My guess is it's barfing on the ' in Patches username. Strangely enough if it's an issue with the quotes in usernames nothing popped up during the username conversion.

I've had a quick look through the punbb convert code but nothing jumps out at me as to where the problem is, and only being new to the code it'll probably be quicker to bring it up here.

If someone can point me in the right direction I can have a look myself.

thanks,

Dan.
Hmm...what needs to be done is $db->escape_string on the username variable coming from punbb username into mybb.

I haven't look at the code but this would be an example:

$where = $db->escape_string("username = 'Patches O'Houlihan' LIMIT 1");
$db->select_query("forums_users", "id,username", $where);


That's rought but hopefully you get the idea. Ryan will probably fix this asap.
(2008-10-30, 06:59 PM)labrocca Wrote: [ -> ]Hmm...what needs to be done is $db->escape_string on the username variable coming from punbb username into mybb.

I haven't look at the code but this would be an example:

$where = $db->escape_string("username = 'Patches O'Houlihan' LIMIT 1");
$db->select_query("forums_users", "id,username", $where);


That's rought but hopefully you get the idea. Ryan will probably fix this asap.

Yeah figured it was something like that but at the moment I'm not familiar enough with the code to be able to easily work out WHERE to make the change Wink

Gonna keep looking to familiarise myself with the code, in teh meantime I might give the 1.4 merge a go see if that has the same probs.
This was already fixed in the 1.4 Version of the code
(2008-10-30, 09:12 PM)Ryan Gordon Wrote: [ -> ]This was already fixed in the 1.4 Version of the code

hmm first time around with the 1.4 code I had exactly the same problem in exactly the same place (except the error message was prettier Wink )

Of course it is 7am and I've yet to reach bed. So I might give it a fresh try later today or this evening with fresh installs all round and see how that goes.

Will also make sure I enable logging etc.

Will let you know how I go.
i am having this same issue when trying to convert a punbb 1.2 database to mybb 1.2.14. it occurs when configurin/converting the threads and halts with the same 1064 limit 1 error for a user id.

Query: SELECT id, username FROM users WHERE username = 'reddit.com: what's new online' LIMIT 1

i am new to sql... so what do i need to query through myphpadmin in order to fix this? if you could give me the steps, that'd be great!

reddit.com: what's new online

thank you in advance!