The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Issue with query
Not sure why this plugin isn't submitting the data to database. Yes, all form fields have names. 3 of the fields are arrays.
PHP Code:
|
#2
|
|||
|
|||
I didn't study the entire thing, but I think the first line of your SQL needs the backquote moved to before the prefix, like:
Code:
INSERT INTO `" . TABLE_PREFIX . "thread_classifieds` ( ETA: also you should use escape_string() for all those values, like: Code:
'" . $vbulletin->db->escape_string($t_id) . "', '" . $vbulletin->db->escape_string($price) . "', etc |
#3
|
||||
|
||||
doesn't the clean_gpc do that?
--------------- Added [DATE]1360438869[/DATE] at [TIME]1360438869[/TIME] --------------- BTW the issue was a { in my elseif statement BEFORE: PHP Code:
PHP Code:
|
#4
|
|||
|
|||
If you use TYPE_STR it only trims spaces off the ends, so it can still contain any character. Also, even if you use the db escape_string function, it could still contain html tags, so you need to be careful what you do with after you read it from the database.
|
#5
|
||||
|
||||
its multiple dropdowns like this [pictured in attachments]
|
#6
|
|||
|
|||
Oh, right. Well, it's true I don't know the details of your application or who would have access to it, so maybe it's not an issue for you. But it is possible for a hacker to submit whatever string they want for any parameter, even if it's supposed to be coming from dropdown. Anyway, just thought I'd mention it.
|
#7
|
||||
|
||||
Would you recommend this?
htmlspecialchars() PHP Code:
|
#8
|
|||
|
|||
That works. You only need to do that if at some point you're going to display the values on a page. In fact now that I think about it, if you use a template and use {vb:var ...} and not {vb:raw }, I believe that takes care of it as well.
I guess another way would be, if they are coming from dropdown menus, make sure they match one of the expected values and if they don't, show an error or use a default. Anyway, sorry, I feel like I've made your task more difficult, and you didn't even ask about that. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|