Commit 866c99b6 authored by pifagor's avatar pifagor Committed by pifagor

Issue #1918478 by mh86, Murz, pifagor, firewaller, ULikeApples,...

Issue #1918478 by mh86, Murz, pifagor, firewaller, ULikeApples, james_kerrigan, earnie, ivan.lewas, Ari Linn, alex_optim, wojtha: Add loc with query string (get parameters) into drupal xml sitemap link
parent e47457f5
......@@ -205,6 +205,9 @@ function xmlsitemap_generate_chunk(stdClass $sitemap, XMLSitemapWriter $writer,
while ($link = $links->fetchAssoc()) {
$link['language'] = $link['language'] != LANGUAGE_NONE ? xmlsitemap_language_load($link['language']) : $url_options['language'];
$parsed_url = drupal_parse_url($link['loc']);
// Remove query or fragment.
$link['loc'] = $parsed_url['path'];
if ($url_options['alias']) {
$link['language'] = is_object($link['language']) ? $link['language']->language : $link['language'];
$link['loc'] = xmlsitemap_get_path_alias($link['loc'], $link['language']);
......@@ -213,6 +216,8 @@ function xmlsitemap_generate_chunk(stdClass $sitemap, XMLSitemapWriter $writer,
'language' => $link['language'],
'xmlsitemap_link' => $link,
'xmlsitemap_sitemap' => $sitemap,
'query' => $parsed_url['query'],
'fragment' => $parsed_url['fragment'],
);
// @todo Add a separate hook_xmlsitemap_link_url_alter() here?
$link_url = url($link['loc'], $link_options + $url_options);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment