The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
My brain is fried after coding for 12 hours and i'm so tired... I'm using $db->escape_string() on a var after cleaning with the input cleaner class (TYPE_STR). All nasties are escaped as they should be to prevent maliciousness, etc... Problem I am having is when calling the data, it displays as follows:
Quote:
How can i clean it nicely for display? It's just text so i don't want to parse it wiht the bbcode parser unless i have to. I also noticed that vb uses (TYPE_NOHTML) to "make safe" the data in profile fields since " becomes " (for instance). Is this sufficient for protecting against SQL injection? Thanks |
#2
|
||||
|
||||
![]()
That's what the escaped version looks like... you shouldn't be displaying it, you should be using it in a query.
![]() SQL injection and XSS are completely different things. If you use escape_string, then it is safe from injection. If you allow users to enter data that will be displayed, then you have to use TYPE_NOHTML (or the function) when either cleaning it (and inserting into DB) OR when displaying it. |
#3
|
||||
|
||||
![]()
Ah! Okie, it's all starting to make sense. I've been working on a rather large modification and everythign works, however I'm just learning how to make everything safe against attacks, etc...
|
#4
|
||||
|
||||
![]()
\r and \n are line breaks. You should run nl2br() on the string.
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|