Welcome Guest, Not a member yet? Register   Sign In
Unable to load the requested class: security
#1

[eluser]s.passiatore[/eluser]
Hi to all, I try to add security class to my autoload array but I give this error:

Code:
Unable to load the requested class: security

This my autoload array:

Code:
$autoload['libraries'] = array('database', 'security');

Where is the error???
Thanks a lot
Stefano
#2

[eluser]s.passiatore[/eluser]
Ok, the CI 2.0.2 the security library is loaded automatically, but if I put this code in my controller I receive an error...

Code:
$params = $this->security->xss_clean($params);

... and the error:
Code:
PHP Fatal error:  Call to a member function xss_clean() on a non-object
#3

[eluser]s.passiatore[/eluser]
anyone???
#4

[eluser]cideveloper[/eluser]
Can you show some more code? Need to see more of the controller to help. Specifically the controller class, the method calling this, and the constructor if any. I have loaded the xss_clean and it works fine. also you might want to set
Code:
$config['log_threshold'] = 4;
in config.php and check your logs to see if anything is not loading. I am getting

Code:
DEBUG - 2011-06-07 09:00:40 --> XSS Filtering completed

Thus I know it is working.
#5

[eluser]InsiteFX[/eluser]
Try using the CI super global object.

InsiteFX
#6

[eluser]goFrendiAsgard[/eluser]
@InsiteFX: I know, this is a very old thread, but what is CI super global object? something like get_instance()?
#7

[eluser]InsiteFX[/eluser]
Yes it's the CI instance.
#8

[eluser]goFrendiAsgard[/eluser]
BTW, I have had a similar problem. And it was solved by visiting this URL:
http://stackoverflow.com/questions/62688...odeigniter
In CodeIgniter (I don't know since what version) "security" class is a helper, not a library.
Therefore, doing this solve the problem:
Code:
$this->load->helper('security');




Theme © iAndrew 2016 - Forum software by © MyBB