The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
clean_array_gpc question
I have a URL that looks like this:
Quote:
all but the first number. If I use TYPE_STR, that doesn't really help. Could someone point me in the right direction? Thank you! |
#2
|
|||
|
|||
How do you want to check it? You can use TYPE_STR then do your own checking. I assume you want to check to avoid vulnerabilities? Then it depends on how you intend to use the value.
|
#3
|
||||
|
||||
What about TYPE_UNIT ?
|
#4
|
|||
|
|||
Set as string and you could do something like this:
PHP Code:
|
#5
|
|||
|
|||
Thank you, This looks doable.
In answer to the others, this is pretty much what I would need to do if I used TYPE_NOHTML (TYPE_STR). TYPE_UINT also returns just the first number. Thank you all! |
#6
|
|||
|
|||
You indeed want to use TYPE_NOHTML unless you actually make use of HTML in certain strings.
|
#7
|
||||
|
||||
Try TYPE_ARRAY_INT (for numbers) or TYPE_ARRAY_STR (for strings)
EDIT: Try the article below. Is superior and it helped me a lot to start coding for vB https://vborg.vbsupport.ru/showthrea...ight=Variables |
#8
|
|||
|
|||
I tried TYPE_ARRAY_INT and it would appear that I got an empty array as a result...
I used fsec=51,71,68,88,93,90 from the URL. I tried print_r and var_dump and they seem to confirm the results. It definitely wasn't a string anymore. explode croaked... 8-) --------------- Added [DATE]1412704140[/DATE] at [TIME]1412704140[/TIME] --------------- I thing that I have noticed is that isset() is not working as expected with $vbulletin->GPC['xx'] It seems to resolve to always true which is not what it says in class_core.php. |
#9
|
||||
|
||||
Quote:
--------------- Added 07 Oct 2014 at 21:44 --------------- Also, because as I seen you're collecting the values from URL, you must use the syntax: PHP Code:
p = Post g = Get |
#10
|
|||
|
|||
[QUOTE=NickTheGreek;2518036]
Also, because as I seen you're collecting the values from URL, you must use the syntax: PHP Code:
but fsec looks like a string.. "1,2,4" I was getting the impression that TYPE_ARRAY_INT would do the conversion? It definitely sets the type. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|