function sanitize_object()
{
if (!$this->has_context()) {
// Set context_id to Logged in user id if context is profile and context_id is not provided
if ('profile' === $this->upload['context'] || 'bp_member' === $this->upload['context']) {
$this->upload['context'] = 'profile';
$this->upload['context_id'] = get_current_user_id();
} else {
global $rtmedia_interaction;
$this->upload['context'] = $rtmedia_interaction->context->type;
$this->upload['context_id'] = $rtmedia_interaction->context->id;
}
}
if (!is_array($this->upload['taxonomy'])) {
$this->upload['taxonomy'] = array($this->upload['taxonomy']);
}
if (!is_array($this->upload['custom_fields'])) {
$this->upload['custom_fields'] = array($this->upload['custom_fields']);
}
if (!$this->has_album_id() || !$this->has_album_permissions()) {
$this->set_album_id();
}
if (!$this->has_author()) {
$this->set_author();
}
if (is_rtmedia_privacy_enable()) {
if (is_rtmedia_privacy_user_overide()) {
$privacy = filter_input(INPUT_POST, 'privacy', FILTER_SANITIZE_NUMBER_INT);
if (is_null($privacy)) {
$this->upload['privacy'] = get_rtmedia_default_privacy();
} else {
$this->upload['privacy'] = $privacy;
}
} else {
$this->upload['privacy'] = get_rtmedia_default_privacy();
}
} else {
$this->upload['privacy'] = 0;
}
}