private function maxUpload($max_size, $translator)
{
$max_upload_filesize_bytes = $this->convertToBytes($max_size);
$preferencesService = $this->container->get('system_preferences_service');
if ($max_upload_filesize_bytes > 0 && $max_upload_filesize_bytes <= min($this->convertToBytes(ini_get('post_max_size')), $this->convertToBytes(ini_get('upload_max_filesize')))) {
$preferencesService->MaxUploadFileSize = strip_tags($max_size);
} else {
$this->get('session')->getFlashBag()->add('error', $translator->trans('newscoop.preferences.error.maxupload', array(), 'system_pref'));
return $this->redirect($this->generateUrl('newscoop_newscoop_systempref_index'));
}
}