~catch-drupal/+junk/pressflow-content-cache-variable

« back to all changes in this revision

Viewing changes to modules/path_alias_cache/path_alias_cache.module

  • Committer: David Strauss
  • Date: 2010-05-12 14:22:55 UTC
  • Revision ID: david@fourkitchens.com-20100512142255-hpr26l1gtk1zkoy5
Erik Webb: Fix E_NOTICE in path_alias_cache.

Show diffs side-by-side

added added

removed removed

Lines of Context:
122
122
  // Check if the system paths for this page were loaded from cache in this
123
123
  // request to avoid writing to cache on every request.
124
124
  $cache = &path_alias_cache_static('path_alias_cache_lookup_path', array());
125
 
  if (!$cache['system_paths']) {
 
125
  if (!array_key_exists('system_paths', $cache)) {
126
126
    // Generate a cache ID (cid) specifically for this page.
127
 
    $cid = $_GET['q'];
 
127
    $cid = array_key_exists('q', $_GET) ? $_GET['q'] : '';
128
128
    // The static $map array used by drupal_lookup_path() includes all
129
129
    // system paths for the page request.
130
 
    if (is_array($cache['map']) && $paths = current($cache['map'])) {
 
130
    if (array_key_exists('map', $cache) && is_array($cache['map']) && $paths = current($cache['map'])) {
131
131
      $data = array_keys($paths);
132
132
      $expire = $_SERVER['REQUEST_TIME'] + variable_get('cache_lifetime', 0);
133
133
      cache_set($cid, $data, 'cache_path', $expire);