CodeIgniter Forums
Fatal error: Call to undefined method CI_Input::xss_clean() - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Fatal error: Call to undefined method CI_Input::xss_clean() (/showthread.php?tid=55636)



Fatal error: Call to undefined method CI_Input::xss_clean() - El Forum - 11-04-2012

[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?




Fatal error: Call to undefined method CI_Input::xss_clean() - El Forum - 11-04-2012

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

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


Fatal error: Call to undefined method CI_Input::xss_clean() - El Forum - 11-04-2012

[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-guide/libraries/input.html

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

Thank you.


Fatal error: Call to undefined method CI_Input::xss_clean() - El Forum - 11-04-2012

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


Fatal error: Call to undefined method CI_Input::xss_clean() - El Forum - 11-05-2012

[eluser]James Star[/eluser]
post.