Thought I'd post an issue here to link it to the greater core issue #918356: WSOD when drupal_get_title called during hook_init and custom 403 or 404 pages are being used

To reproduce, take a stock d6 with token & opensearch, enable both and go to an arbitrary url to trigger a 404 page.

Comments

avpaderno’s picture

Version: 6.x-1.3 » 6.x-1.x-dev

Since version 6.x-1.4-beta1, the module checks if Drupal is returning a 404 or 403 error page.

  // Verify the site is not offline, or Drupal is not returning an error page.
  $bool = (
    (
      variable_get('site_offline', 0) &&
      !user_access('administer site configuration')
    ) ||
    preg_match('@HTTP/1\.[01]\x20+403[^a-zA-Z0-9]@', $headers) ||
    preg_match('@HTTP/1\.[01]\x20+404[^a-zA-Z0-9]@', $headers)
  );
  if (!$bool) {
    // …
  }

May you verify that version is not causing the WSOD anymore?

Anonymous’s picture

Version: 6.x-1.x-dev » 6.x-1.3
Evan King’s picture

Version: 6.x-1.3 » 6.x-1.4-beta1

I've found the same issue, using 6.x-1.4-beta1

The problem seems to be that when we get the headers on line 19, the string only contains "Content-Type: text/html; charset=utf-8" - no response codes yet.

I've tried increasing the weight of the module so that it runs last, but this made no difference.

dstol’s picture

Yeah, same results as suedegambit, it still fatals.

Anonymous’s picture

I think that hook_init() should be replaced from hook_preprocess_page(); doing so, the headers would contain the values the module is looking for, and the problem of looking for the value of tokens too early should be resolved too.

avpaderno’s picture

Version: 6.x-1.4-beta1 » 6.x-1.x-dev
Issue summary: View changes
Status: Active » Closed (outdated)

I am closing this issue, which is for a not supported Drupal version.