Welcome Guest, Not a member yet? Register   Sign In
String passed to callback function sanitized?
#2

[eluser]Aken[/eluser]
It depends on what you're doing with the value in your callback.

- If you have XSS clean enabled globally in your config, fields will always be sanitized when calling them through $this->input->post().
- Unless you need to access another field, you don't need $this->input->post() in your callback. The value will automatically be passed as the first parameter of your callback method.
- The rules you specify for a field are run in that order. If you put xss_clean before your callback, it will be cleaned prior to your callback receiving it. Third, you can always run xss_clean on an individual POST element whenever you want by doing:

Code:
$this->input->post('item', true); // Note the TRUE

Maybe explain what you're doing in your callback to get advice specific for your situation.


Messages In This Thread
String passed to callback function sanitized? - by El Forum - 09-04-2012, 11:29 AM
String passed to callback function sanitized? - by El Forum - 09-04-2012, 02:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB