vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Issue with ' in user names (https://vborg.vbsupport.ru/showthread.php?t=107262)

ogden2k 02-06-2006 01:41 AM

Issue with ' in user names
 
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

Quote:

Originally Posted by ogden2k
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

1 Attachment(s)
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.


All times are GMT. The time now is 11:41 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01134 seconds
  • Memory Usage 1,710KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete