Issue #1999370 by chertzog, kim.pepper: Use Symfony Request for file module.

8.0.x
Dries 2013-06-20 14:34:34 -04:00
parent 0ed76f0dab
commit 23faf5a2a2
2 changed files with 5 additions and 3 deletions

View File

@ -197,8 +197,9 @@ function file_requirements($phase) {
// Check the server's ability to indicate upload progress.
if ($phase == 'runtime') {
$implementation = file_progress_implementation();
$apache = strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== FALSE;
$fastcgi = strpos($_SERVER['SERVER_SOFTWARE'], 'mod_fastcgi') !== FALSE || strpos($_SERVER["SERVER_SOFTWARE"], 'mod_fcgi') !== FALSE;
$server_software = Drupal::request()->server->get('SERVER_SOFTWARE');
$apache = strpos($server_software, 'Apache') !== FALSE;
$fastcgi = strpos($server_software, 'mod_fastcgi') !== FALSE || strpos($server_software, 'mod_fcgi') !== FALSE;
$description = NULL;
if (!$apache) {
$value = t('Not enabled');

View File

@ -736,7 +736,8 @@ function file_ajax_upload() {
$form_parents = func_get_args();
$form_build_id = (string) array_pop($form_parents);
if (empty($_POST['form_build_id']) || $form_build_id != $_POST['form_build_id']) {
$request = \Drupal::request();
if (!$request->request->has('form_build_id') || $form_build_id != $request->request->get('form_build_id')) {
// Invalid request.
drupal_set_message(t('An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (@size) that this server supports.', array('@size' => format_size(file_upload_max_size()))), 'error');
$response = new AjaxResponse();