You are here

function feedback_match_path in Feedback 7.2

Check if the current path matches any pattern in a set of patterns.

Parameters

$patterns: String containing a set of patterns separated by \n, \r or \r\n.

Return value

Boolean value: TRUE if the current path or alias matches a pattern.

1 call to feedback_match_path()
feedback_page_build in ./feedback.module
Implements hook_page_build().

File

./feedback.module, line 314
Allows site visitors and users to report issues about this site.

Code

function feedback_match_path($patterns) {

  // Convert path to lowercase. This allows comparison of the same path
  // with different case. Ex: /Page, /page, /PAGE.
  $patterns = drupal_strtolower($patterns);

  // Convert the current path to lowercase.
  $path = drupal_strtolower(drupal_get_path_alias($_GET['q']));

  // Compare the lowercase internal and lowercase path alias (if any).
  $page_match = drupal_match_path($path, $patterns);
  if ($path != $_GET['q']) {
    $page_match = $page_match || drupal_match_path($_GET['q'], $patterns);
  }
  return $page_match;
}