You are here

function query_parameters_to_url_page_cache_object_alter in Query Parameters To URL 7

Implements hook_page_cache_object_alter().

File

./query_parameters_to_url.module, line 737
Query Arguments To URL module.

Code

function query_parameters_to_url_page_cache_object_alter($cache) {
  if (variable_get(QUERY_PARAMETERS_TO_URL_ENABLED, TRUE)) {

    // Check whether the path was altered in inbound alter function, which means
    // we should change the cache cid to match the initial inbound URL, instead
    // of the rewritten Request URI.
    $path_altered =& drupal_static('query_parameters_to_url_url_inbound_alter', FALSE);
    if ($path_altered) {
      $inbound_path =& drupal_static('query_parameters_to_url_url_inbound_alter_inbound_path', '');
      if (!empty($inbound_path)) {
        global $base_root;
        $new_cid = $base_root . base_path() . $inbound_path;
        $cache->cid = $new_cid;
      }
    }
  }
}