You are here

function path2ban_pitfall in path2ban 7

1 string reference to 'path2ban_pitfall'
path2ban_menu in ./path2ban.module
Implements hook_menu().

File

./path2ban.module, line 99
path2ban module.

Code

function path2ban_pitfall($state = 404) {
  $pages = drupal_strtolower(variable_get('path2ban_list', ''));

  // Convert the Drupal path to lowercase.
  $destination = drupal_strtolower($_GET['destination']);

  // Compare the lowercase paths.
  $page_match = drupal_match_path($destination, $pages);
  if ($page_match) {
    path2ban_action();
  }

  // Return menu code
  $result = $state == 403 ? MENU_ACCESS_DENIED : MENU_NOT_FOUND;
  return $result;
}