function clean($values = array()) { $cleaned = parent::clean($values); if (!empty($cleaned['location'])) { if ($cleaned['location'] == 'example: company/about_us') { $cleaned['location'] = ''; } $segments = explode('/', $cleaned['location']); $cleaned_segments = array(); foreach ($segments as $val) { if (!empty($val)) { $cleaned_segments[] = $val; } } $cleaned['location'] = implode('/', $cleaned_segments); } return $cleaned; }