ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Unable to load the requested class: security

June 01, 2011 11:30am

Subscribe [4]
  • #1 / Jun 01, 2011 11:30am

    s.passiatore

    6 posts

    Hi to all, I try to add security class to my autoload array but I give this error:

    Unable to load the requested class: security

    This my autoload array:

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

    Where is the error???
    Thanks a lot
    Stefano

  • #2 / Jun 01, 2011 11:49am

    s.passiatore

    6 posts

    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…

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

    ... and the error:

    PHP Fatal error:  Call to a member function xss_clean() on a non-object
  • #3 / Jun 07, 2011 6:14am

    s.passiatore

    6 posts

    anyone???

  • #4 / Jun 07, 2011 10:05am

    cideveloper

    312 posts

    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

    $config['log_threshold'] = 4;

    in config.php and check your logs to see if anything is not loading. I am getting

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

    Thus I know it is working.

  • #5 / Jun 07, 2011 11:52am

    InsiteFX

    6819 posts

    Try using the CI super global object.

    InsiteFX

  • #6 / Feb 21, 2013 10:09am

    goFrendiAsgard

    125 posts

    @InsiteFX: I know, this is a very old thread, but what is CI super global object? something like get_instance()?

  • #7 / Feb 21, 2013 10:25am

    InsiteFX

    6819 posts

    Yes it’s the CI instance.

  • #8 / Feb 21, 2013 11:49pm

    goFrendiAsgard

    125 posts

    BTW, I have had a similar problem. And it was solved by visiting this URL:
    http://stackoverflow.com/questions/6268884/security-class-in-codeigniter
    In CodeIgniter (I don’t know since what version) “security” class is a helper, not a library.
    Therefore, doing this solve the problem:

    $this->load->helper('security');
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases