You are here

function intlinks_is_special_path in Internal Links 7

Same name and namespace in other branches
  1. 8 intlinks_hide_bad_links.inc \intlinks_is_special_path()
  2. 6 intlinks_hide_bad_links.inc \intlinks_is_special_path()
  3. 7.2 intlinks_hide_bad_links.inc \intlinks_is_special_path()
1 call to intlinks_is_special_path()
_intlinks_process_bad_link in ./intlinks_hide_bad_links.inc
Processes regex matches of links for intlinks_hide_bad_filter_process().

File

./intlinks_hide_bad_links.inc, line 61

Code

function intlinks_is_special_path($path) {

  // Change any numeric parts of the path to % placeholders.
  // This is the format used in the menu_router table. The % symbols take the
  // place of term ids, node ids, etc.
  $path_parts = explode('/', $path);
  foreach ($path_parts as $i => $part) {
    if (ctype_digit($part)) {
      $path_parts[$i] = '%';
    }
  }
  $path = implode('/', $path_parts);

  // Check $path for a match in the menu_router table.
  return (bool) db_query("SELECT fit FROM {menu_router} WHERE path = :path", array(
    ':path' => $path,
  ))
    ->fetchField();
}