Log in

View Full Version : Issue with ' in user names


ogden2k
02-06-2006, 01:41 AM
I have a chatbox that allows you to enter a text message into a table in the vB DB. The issue that I am having is that if an account has a tick they receive an error message and cannot use the CB.

How in PHP do I set it so that MySQL ignores that tick? Please let me know if you need to see the PHP code.

tehste
02-06-2006, 02:12 AM
I have a chatbox that allows you to enter a text message into a table in the vB DB. The issue that I am having is that if an account has a tick they receive an error message and cannot use the CB.

How in PHP do I set it so that MySQL ignores that tick? Please let me know if you need to see the PHP code.

old way:
addslashes($userinfo['username'])
new way:
$vbulletin->db->escape_string($vbulletin->userinfo['username'])

anyway really u shud be storing userid in the table.
Data normalization or whatever.

Marco van Herwaarden
02-06-2006, 06:46 AM
And i woudl be very carefull when using a modification that has this kind of errors.

The error message is not the worst, if the above is happening, your script is open to SQL-injections (a hacker could get direct access to your database and even modify data).

ogden2k
02-06-2006, 11:11 AM
I had someone upgrade this script from 3.0.x to 3.5.x and they have implemented the security precations you have mentioned. So my 3.5 script is fine, but I still use the 3.0.x script on a another board and am not sure where to implement the changes in it. I have attached the script.

Thank you for the help!

ogden2k
02-08-2006, 12:30 PM
I have resolved the issue on my own.