Issue #3084935 by kiamlaluno, Taran2L, mcdruid, atheia, Liam Morland: element_children() and DrupalRequestSanitizer::stripDangerousValues() should not use integers as an array
parent
97bd4f7203
commit
edb77684bd
|
@ -6653,7 +6653,7 @@ function element_children(&$elements, $sort = FALSE) {
|
|||
$children = array();
|
||||
$sortable = FALSE;
|
||||
foreach ($elements as $key => $value) {
|
||||
if ($key === '' || $key[0] !== '#') {
|
||||
if (is_int($key) || $key === '' || $key[0] !== '#') {
|
||||
$children[$key] = $value;
|
||||
if (is_array($value) && isset($value['#weight'])) {
|
||||
$sortable = TRUE;
|
||||
|
|
|
@ -99,7 +99,7 @@ class DrupalRequestSanitizer {
|
|||
protected static function stripDangerousValues($input, array $whitelist, array &$sanitized_keys) {
|
||||
if (is_array($input)) {
|
||||
foreach ($input as $key => $value) {
|
||||
if ($key !== '' && $key[0] === '#' && !in_array($key, $whitelist, TRUE)) {
|
||||
if ($key !== '' && ((string) $key)[0] === '#' && !in_array($key, $whitelist, TRUE)) {
|
||||
unset($input[$key]);
|
||||
$sanitized_keys[] = $key;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue