You are here

function disable_messages_path_match in Disable Messages 8

To find current path is matched any of the filter paths.

Parameters

array $filter_paths: Array of filter paths.

string $path: Path of current page.

Return value

bool Returns TRUE if paths are match.

1 call to disable_messages_path_match()
disable_messages_apply_filters in ./disable_messages.module
Apply the filters to the messages.

File

./disable_messages.module, line 167
The disable_messages module file.

Code

function disable_messages_path_match(array $filter_paths, $path) {
  $page_match = FALSE;
  foreach ($filter_paths as $filter_path) {
    $filter_path = disable_messages_remove_white_space($filter_path);
    if (substr($filter_path, -1) == '*') {
      if (preg_match($filter_path, $path)) {
        $page_match = TRUE;
      }
    }
    if ($path == $filter_path) {
      $page_match = TRUE;
    }
  }
  return $page_match;
}