vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=328310

Pulling a GPC variable
by Dr.CustUmz
28 Oct 2020 15:24

I am working on a product, building from previously existing products, this is a page within the admincp.
I am wondering why sometimes I am able to pull a GPC variable and other times I am not, I am having this issue in multiple spots but this is just the smallest one to give the example.

I am able to pull the productid with:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

But I cant get the catid to pull:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

This is the complete page in question, Just a simple confirmation page.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

A way I get around this is to use a query, but since I can pull the productid, I just dont understand why I cant pull the catid, when they were both submitted through the same form.

This is how I currently solve this problem:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


x iJailBreak x 29 Oct 2020 21:49

Quote:

Originally Posted by Dr.CustUmz (Post 2604412)
I am working on a product, building from previously existing products, this is a page within the admincp.
I am wondering why sometimes I am able to pull a GPC variable and other times I am not, I am having this issue in multiple spots but this is just the smallest one to give the example.

I am able to pull the productid with:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

But I cant get the catid to pull:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

This is the complete page in question, Just a simple confirmation page.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

A way I get around this is to use a query, but since I can pull the productid, I just dont understand why I cant pull the catid, when they were both submitted through the same form.

This is how I currently solve this problem:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Out of curiosity, if you var_dump($vbulletin->GPC); what does it return? And is it definitely present on var_dump($_REQUEST);?

Dr.CustUmz 29 Oct 2020 22:49

var_dump($_REQUEST);

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

var_dump($vbulletin->GPC);

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I am a bit baffled why there are references to products I have not installed on this fresh install, The only product I have installed is the product I am working on.

This is the portion in my page where the productid and catid are added, I have stripped a majority of this page but kept what should be relevant.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I guess I should be asking is, how is a GPC variable even created? Because I know I can use productid on numerous pages, although I am unable to use catid on these pages.

x iJailBreak x 30 Oct 2020 14:28

Quote:

Originally Posted by Dr.CustUmz (Post 2604434)
var_dump($_REQUEST);

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

var_dump($vbulletin->GPC);

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I am a bit baffled why there are references to products I have not installed on this fresh install, The only product I have installed is the product I am working on.

This is the portion in my page where the productid and catid are added, I have stripped a majority of this page but kept what should be relevant.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I guess I should be asking is, how is a GPC variable even created? Because I know I can use productid on numerous pages, although I am unable to use catid on these pages.

Interesting to note catid does not get passed even in $_REQUEST.. it definitely has a named field?

It'll only get registered in $vbulletin->GPC if it's first registered in $_REQUEST before your call to $vbulletin->input->clean_array_gpc();

In regards to it referencing plugins you don't have activated, I assume they are being passed in via $_COOKIE (which clean_gpc/clean_array_gpc will also run on).


All times are GMT. The time now is 20:10.

Powered by vBulletin® Version 3.8.14
Copyright © 2021, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.