Welcome Guest, Not a member yet? Register   Sign In
$this-->input->post() returns false while $_POST is full
#1

[eluser]Rys[/eluser]
Hello,

I'm not sure if that's a bug - I've encountered this issue today (CI 2.0).
I'm POSTing a standard form, yet $this->input->post() always returns false, regardless of XSS filtering setting.

All the values actually exist ($_POST returns array). I can access all variables individually by calling $this->input->post("variable_name").

Any ideas...?
#2

[eluser]InsiteFX[/eluser]
Code:
$this->input->post('user_name');

InsiteFX
#3

[eluser]Rys[/eluser]
[quote author="InsiteFX" date="1301677499"]
Code:
$this->input->post('user_name');
[/quote]

Thank you, but according to CI documentation:
Code:
$this->input->post(); // returns all POST items with XSS filter

So I expected to get an array filled with all POST variables. I need to traverse through all of them. In my case form fields are generated automatically, so I can't anticipate variable names.
#4

[eluser]InsiteFX[/eluser]
Ya, I just double checked and your right!

So do you have the CSRF set to FALSE? But I think this flag still checks the input->post!

If so and this is returning a blank array then I would report it as a BUG!

InsiteFX
#5

[eluser]Rys[/eluser]
[quote author="InsiteFX" date="1301681047"]
So do you have the CSRF set to FALSE? But I think this flag still checks the input->post!
If so and this is returning a blank array then I would report it as a BUG!
[/quote]


Here's my config.php:

Code:
$config['csrf_protection'] = FALSE;

$this->input->post() contains boolean false.
$_POST contains standard array.

So I guess it needs to be corrected...
#6

[eluser]InsiteFX[/eluser]
Try this and see if it returns your array items:
Code:
$this->input->post(NULL, TRUE);

InsiteFX
#7

[eluser]Rys[/eluser]
[quote author="InsiteFX" date="1301684133"]Try this and see if it returns your array items:
Code:
$this->input->post(NULL, TRUE);
[/quote]

Already did it Wink Tried $this->input->post(NULL, FALSE) as well, $this->input->post(""), tried to disable whole XSS filtering. No visible effect.

It's strange, as CI should clear $_POST, shouldn't it?
#8

[eluser]InsiteFX[/eluser]
Did you try using the CI 2.0.1 version?

This could have been a bug they fixed it!

InsiteFX
#9

[eluser]Rys[/eluser]
[quote author="InsiteFX" date="1301684728"]Did you try using the CI 2.0.1 version?
This could have been a bug they fixed it!
[/quote]


Yay, a humble programmer needs to be focused all the time Wink
Changelog 2.0.0 -> 2.0.1:
Quote:Input Class methods post() and get() will now return a full array if the first argument is not provided.

Thanks for the hint Smile
#10

[eluser]InsiteFX[/eluser]
Sorry last straw that I could think of!
I use CI 2.0.1 Thats Why!

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB