Currently we detect 403/404 errors like this (ignoring logintoboggan logic):

// Include both the path alias and normal path for matching.
$current_path = array(drupal_get_path_alias($_GET['q']));
if ($current_path != $_GET['q']) {
  $current_path[] = $_GET['q'];
}

if (in_array(variable_get("site_$error", ''), $current_path)) {
  $this->condition_met($context);
}

But if site_403 or site_404 variables aren't set, this approach can't work as you're matching an empty string against the current path. As a fallback to the path based approach, we could look at the actual headers being built by drupal http://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_g....

Comments

thedavidmeister’s picture

Here is a patch that checks the headers as a fallback, but only if required. Unfortunately I need this on a client project so it contains my patch for #1196022: Supporting LoginToboggan so I can cleanly add them both to the make file.

It should be trivial to split them out though, there's only about 20 lines of code in it.

thedavidmeister’s picture

Status: Active » Needs review

needs review

mynameiscorey’s picture

Status: Needs review » Reviewed & tested by the community

This patch is working reliably for me on production sites. Marking as RTBC.

snufkin’s picture

Status: Reviewed & tested by the community » Fixed

Good enough for me, thanks. Committed, new stable release is on the way.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.