EllisLab text mark
Advanced Search
     
Fatal error: Call to undefined method CI_Input::xss_clean()
Posted: 04 November 2012 08:27 PM   [ Ignore ]
Joined: 2012-11-04
3 posts

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?

 
Posted: 04 November 2012 11:04 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2010-06-17
163 posts

They moved the function.

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

 
Posted: 04 November 2012 11:09 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2012-11-04
3 posts

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.

 
Posted: 04 November 2012 11:52 PM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Joined: 2010-06-17
163 posts

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

 
Posted: 05 November 2012 03:35 PM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Joined: 2012-11-04
3 posts

post.