Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 314684

drupal_deliver_html_page() might call drupal_render_page() with an integer argument.

$
0
0

Summary

In drupal_deliver_html_page() in some circumstances menu_execute_active_handler() is called and its return value is directly passed to drupal_render_page() even if it is an integer

Steps to reproduce

Start with a clean site (ie. minimal profile), then:

  1. Switch on maintenance_mode drush vset maintenance_mode 1
  2. Set a custom access denied page drush vset site_403 'non-empty'
  3. Access the cron.php of your site curl https://example.com/cron.php

The result is this set of errors:

Cannot use a scalar value as an array block.module:271                                                                                                                                                   
Invalid argument supplied for foreach() common.inc:6594                                                                                                                                                  
Cannot use a scalar value as an array common.inc:6051                                                                                                                                                   
Cannot use a scalar value as an array common.inc:6106

Depending on what othen modules you have activated there might be even more errors.

Analysis

drupal_deliver_html_page() checks only for MENU_NOT_FOUND and MENU_ACCESS_DENIED before passing the value to drupal_render_page(). This is not sufficent.

Proposed solution

Check for is_int($return) instead of just specific integers.


Viewing all articles
Browse latest Browse all 314684

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>