Commit 6c6045d6 authored by Drew Webber's avatar Drew Webber
Browse files

Issue #2112325 by mfb, lazysoundsystem: Warning: gzinflate(): data error in...

Issue #2112325 by mfb, lazysoundsystem: Warning: gzinflate(): data error in drupal_serve_page_from_cache()
parent 30e76c63
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1602,7 +1602,7 @@ function drupal_page_header() {
 */
function drupal_serve_page_from_cache(stdClass $cache) {
  // Negotiate whether to use compression.
  $page_compression = !empty($cache->data['page_compressed']);
  $page_compression = !empty($cache->data['page_compressed']) && !empty($cache->data['body']);
  $return_compressed = $page_compression && isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE;

  // Get headers set in hook_boot(). Keys are lower-case.
+3 −0
Original line number Diff line number Diff line
@@ -236,6 +236,9 @@ class BootstrapPageCacheTestCase extends DrupalWebTestCase {
    $this->assertTitle(t('Welcome to @site-name | @site-name', array('@site-name' => variable_get('site_name', 'Drupal'))), 'Site title matches.');
    $this->assertRaw('</html>', 'Page was not compressed.');

    // Verify that an empty page doesn't throw an error when being decompressed.
    $this->drupalGet('system-test/empty-page');

    // Disable compression mode.
    variable_set('page_compression', FALSE);

+13 −0
Original line number Diff line number Diff line
@@ -141,6 +141,13 @@ function system_test_menu() {
    'type' => MENU_CALLBACK,
  );

  $items['system-test/empty-page'] = array(
    'title' => 'Test page cache with empty page.',
    'page callback' => 'system_test_empty_page',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );

  return $items;
}

@@ -532,6 +539,12 @@ function system_test_drupal_get_filename_with_schema_rebuild() {
  return '';
}

/**
 * Page callback to output an empty page.
 */
function system_test_empty_page() {
}

/**
 * Implements hook_watchdog().
 */