Issue #2884171 by mcdruid, Seth Snyder: The drupal_render() function could use a bit more protection
parent
40d1dbb9f4
commit
6d7d36463c
|
@ -6088,7 +6088,7 @@ function drupal_render_page($page) {
|
|||
*/
|
||||
function drupal_render(&$elements) {
|
||||
// Early-return nothing if user does not have access.
|
||||
if (empty($elements) || (isset($elements['#access']) && !$elements['#access'])) {
|
||||
if (empty($elements) || !is_array($elements) || (isset($elements['#access']) && !$elements['#access'])) {
|
||||
return '';
|
||||
}
|
||||
|
||||
|
|
|
@ -1989,6 +1989,11 @@ class DrupalRenderTestCase extends DrupalWebTestCase {
|
|||
'value' => '',
|
||||
'expected' => '',
|
||||
),
|
||||
array(
|
||||
'name' => 'not a render array',
|
||||
'value' => 'this is not an array',
|
||||
'expected' => '',
|
||||
),
|
||||
array(
|
||||
'name' => 'no access',
|
||||
'value' => array(
|
||||
|
|
Loading…
Reference in New Issue