diff --git a/core/modules/file/file.install b/core/modules/file/file.install index 48f33dee86e..0c97f82eec7 100644 --- a/core/modules/file/file.install +++ b/core/modules/file/file.install @@ -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'); diff --git a/core/modules/file/file.module b/core/modules/file/file.module index 87b263e8cf1..f7a7c8660e1 100644 --- a/core/modules/file/file.module +++ b/core/modules/file/file.module @@ -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();