Sanitize attributes before saving

Permalink
I'm using custom attributes and save them using this:

$list = UserAttributeKey::getList();
foreach($list as $ak){
     $ak->saveAttributeForm($ui);
}


What would be the best way to sanitize certain post values before they're saved?

Thanks, Adri

A3020