You are here

function context_error_get_response_from_headers in Context error 6

Parse the HTTP response from the headers currently set by Drupal.

1 call to context_error_get_response_from_headers()
context_error_context_condition_error::execute in plugins/context_error_context_conditions.inc
Execute.

File

./context_error.module, line 49
Implement triggers for 404 and 403 pages.

Code

function context_error_get_response_from_headers() {
  $headers = drupal_get_headers();
  $response = 200;
  if (FALSE !== ($status_pos = strpos($headers, ':status:'))) {
    $response = substr($headers, $status_pos + 9, 3);
  }
  return $response;
}