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....
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 1920748-get-error-status-from-headers-1.patch | 2.21 KB | thedavidmeister |
Comments
Comment #1
thedavidmeister commentedHere 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.
Comment #2
thedavidmeister commentedneeds review
Comment #3
mynameiscorey commentedThis patch is working reliably for me on production sites. Marking as RTBC.
Comment #4
snufkin commentedGood enough for me, thanks. Committed, new stable release is on the way.