0) { $filename = basename($submittedFile['name']); if (!is_uploaded_file($submittedFile['tmp_name'])) { throw new InternalErrorException(__('PHP says file was not uploaded. Are you attacking me?')); } $file = new File($submittedFile['tmp_name']); $file_content = $file->read(); $file->close(); if ((isset($submittedFile['error']) && $submittedFile['error'] == 0) || (!empty($submittedFile['tmp_name']) && $submittedFile['tmp_name'] != '') ) { if (!$file_content) { throw new InternalErrorException(__('PHP says file was not uploaded. Are you attacking me?')); } } $text = $file_content; } else { $text = $alternate ? $alternate : ''; } return $text; } }