Welcome Guest, Not a member yet? Register   Sign In
xss_clean, security helper and library throwing non-object error
#1

[eluser]Billy Khan[/eluser]
When using the security helper, do we need to load the security library? like so?
Code:
$this->load->library('security');
$this->load->helper('security');

This throws an error:
Code:
$this->load->helper('security');
$x = xss_clean("hello");

To make it work i have to do this:
Code:
$this->load->library('security');
$this->load->helper('security');
$x = xss_clean("hello");

This is CI 2.0 with global xss filtering turned off.

Am i using the security helper incorrectly? I assume the helper would load the library.
#2

[eluser]InsiteFX[/eluser]
The Security library should be loaded first then the Sescurity helper should be loaded.

InsiteFX
#3

[eluser]Billy Khan[/eluser]
Agree. I think this should be reported as a bug. Do i Just leave it here to be picked up or report it somewhere?
#4

[eluser]InsiteFX[/eluser]
It's not a bug, Libraries are always loaded first then the helpers. The helpers sometimes depend on the library methods.

InsiteFX
#5

[eluser]Billy Khan[/eluser]
Ah, i thought since the helper needed the library that it would have loaded it without it having to be loaded separately. Thats cool.




Theme © iAndrew 2016 - Forum software by © MyBB