Revision 15:e200cb7efeb3 core/modules/file/src/Element/ManagedFile.php

View differences:

core/modules/file/src/Element/ManagedFile.php
8 8
use Drupal\Core\Ajax\AjaxResponse;
9 9
use Drupal\Core\Ajax\ReplaceCommand;
10 10
use Drupal\Core\Form\FormStateInterface;
11
use Drupal\Core\Render\Element;
11 12
use Drupal\Core\Render\Element\FormElement;
12 13
use Drupal\Core\Site\Settings;
13 14
use Drupal\Core\Url;
......
175 176

  
176 177
    $form_parents = explode('/', $request->query->get('element_parents'));
177 178

  
179
    // Sanitize form parents before using them.
180
    $form_parents = array_filter($form_parents, [Element::class, 'child']);
181

  
178 182
    // Retrieve the element to be rendered.
179 183
    $form = NestedArray::getValue($form, $form_parents);
180 184

  

Also available in: Unified diff