function drupal_match_path

cis7 path.inc drupal_match_path($path, $patterns)
cle7 path.inc drupal_match_path($path, $patterns)
elmsmedia7 path.inc drupal_match_path($path, $patterns)
icor7 path.inc drupal_match_path($path, $patterns)
meedjum_blog7 path.inc drupal_match_path($path, $patterns)
mooc7 path.inc drupal_match_path($path, $patterns)

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

Parameters

$path: The path to match.

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

Return value

Boolean value: TRUE if the path matches a pattern, FALSE otherwise.

10 calls to drupal_match_path()
admin_theme_custom_theme in sites/all/modules/ulmus/admin_theme/admin_theme.module
Implementation of hook_custom_theme().
advagg_mod_match_path in sites/all/modules/ulmus/advagg/advagg_mod/advagg_mod.module
Transforms all CSS files into inline CSS.
block_block_list_alter in modules/block/block.module
Implements hook_block_list_alter().
boost_is_cacheable in sites/all/modules/ulmus/boost/boost.module
Determines whether a given url can be cached or not by boost.
ctools_path_visibility_ctools_access_check in sites/all/modules/ulmus/ctools/plugins/access/path_visibility.inc
Check for access.

... See full list

File

includes/path.inc, line 312
Functions to handle paths in Drupal, including path aliasing.

Code

function drupal_match_path($path, $patterns) {
  $regexps = &drupal_static(__FUNCTION__);

  if (!isset($regexps[$patterns])) {
    // Convert path settings to a regular expression.
    // Therefore replace newlines with a logical or, /* with asterisks and the <front> with the frontpage.
    $to_replace = array(
      '/(\r\n?|\n)/', // newlines
      '/\\\\\*/', // asterisks
      '/(^|\|)\\\\<front\\\\>($|\|)/', // <front>
    );
    $replacements = array(
      '|',
      '.*',
      '\1' . preg_quote(variable_get('site_frontpage', 'node'), '/') . '\2',
    );
    $patterns_quoted = preg_quote($patterns, '/');
    $regexps[$patterns] = '/^(' . preg_replace($to_replace, $replacements, $patterns_quoted) . ')$/';
  }
  return (bool) preg_match($regexps[$patterns], $path);
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.