You are here

function _googleanalytics_match_path in Google Analytics 5

D6 backport of drupal_match_path().

1 call to _googleanalytics_match_path()
_googleanalytics_visibility_pages in ./googleanalytics.module
Based on visibility setting this function returns TRUE if GA code should be added to the current page and otherwise FALSE.

File

./googleanalytics.module, line 688

Code

function _googleanalytics_match_path($path, $patterns) {
  static $regexps;
  if (!isset($regexps[$patterns])) {
    $regexps[$patterns] = '/^(' . preg_replace(array(
      '/(\\r\\n?|\\n)/',
      '/\\\\\\*/',
      '/(^|\\|)\\\\<front\\\\>($|\\|)/',
    ), array(
      '|',
      '.*',
      '\\1' . preg_quote(variable_get('site_frontpage', 'node'), '/') . '\\2',
    ), preg_quote($patterns, '/')) . ')$/';
  }
  return preg_match($regexps[$patterns], $path);
}