Commit 23faf5a2 authored by Dries's avatar Dries

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

parent 0ed76f0d
......@@ -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');
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment