You are here

function fast_404_path_check in Fast 404 7

Same name and namespace in other branches
  1. 6 fast_404.inc \fast_404_path_check()

Check a Drupal path to see if it really exists and load a fast 404 if not.

1 call to fast_404_path_check()
fast_404_boot in ./fast_404.module
Implements hook_boot().
3 string references to 'fast_404_path_check'
Fast404CustomReponseTestCase::test410Response in ./fast_404.test
Fast404LocaleTestCase::testLocalisedContent in ./fast_404.test
Fast404PathTestCase::testPathCheck in ./fast_404.test

File

./fast_404.inc, line 90

Code

function fast_404_path_check() {
  $valid = TRUE;
  $query = $_GET['q'];
  if (variable_get('fast_404_path_check', FALSE) && !empty($query)) {

    // Determine if we have the db_query function. If so, we are in boot and
    // have functions. If not we are in settings.php and do not have functions.
    if (function_exists('db_query')) {
      $valid = fast_404_validate_path_drupal();
    }
    else {
      $valid = fast_404_validate_path_sql();
    }
  }
  if (!$valid) {
    fast_404_error_return(TRUE, variable_get('fast_404_return_gone', FALSE));
  }
  define('FAST_404_PATH_CHECKED', TRUE);
}