CodeIgniter Forums

Full Version: Fatal error: Call to undefined method CI_Input::xss_clean()
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]James Star[/eluser]
Hello,

I am doing an upgrade from 1.7.x to 2.x.

And I have some code that is pointing to the xss_clean method in Input Class.

Here is the code: $this->input->xss_clean($cleanthis);

And I am retrieving this error: Fatal error: Call to undefined method CI_Input::xss_clean() in ...

I also can't seem to find where the Input class might have been loaded in the previous version, and I tried to do a manual load above the code: $this->load->library('input'). But I still get the same error.

Anyone got any ideas?

El Forum

[eluser]NeoArc[/eluser]
They moved the function.

$login = $this->security->xss_clean($login)

El Forum

[eluser]James Star[/eluser]
Okay, very interesting.

We also found out we can do this - $this->input->post('postitem', TRUE);

See URL: http://ellislab.com/codeigniter/user-gui...input.html

Which way is better? Do they both do the same thing?

Thank you.

El Forum

[eluser]NeoArc[/eluser]
It depends on how the value is obtained (POST, database, text file,..).
They do the same thing.

El Forum

[eluser]James Star[/eluser]
post.