Commit 65d8700f authored by andrei.dincu's avatar andrei.dincu

Issue #2249723 by andrei.dincu: Do not allow...

Issue #2249723 by andrei.dincu: Do not allow xmlsitemap_sitemap_get_context_hash to modify sitemap context
parent c6e985f7
......@@ -582,7 +582,8 @@ function _xmlsitemap_sitemap_rehash_all() {
// Force a rehash of all sitemaps.
$sitemaps = xmlsitemap_sitemap_load_multiple(FALSE);
foreach ($sitemaps as $sitemap) {
$hash = xmlsitemap_sitemap_get_context_hash($sitemap->context);
$context = $sitemap->context;
$hash = xmlsitemap_sitemap_get_context_hash($context);
if ($hash != $sitemap->smid) {
xmlsitemap_sitemap_save($sitemap);
}
......
......@@ -446,7 +446,8 @@ function xmlsitemap_sitemap_save(XmlSitemapInterface $sitemap) {
//$sitemap->is_new = empty($sitemap->getId());
//$sitemap->old_smid = $sitemap->is_new ? NULL : $sitemap->smid;
$sitemap->setOriginalId($sitemap->isNew() ? NULL : $sitemap->getId());
$sitemap->setId(xmlsitemap_sitemap_get_context_hash($sitemap->getContext()));
$context = $sitemap->getContext();
$sitemap->setId(xmlsitemap_sitemap_get_context_hash($context));
// If the context was changed, we need to perform additional actions.
if (!$sitemap->isNew() && $sitemap->getId() != $sitemap->getOriginalId()) {
// Rename the files directory so the sitemap does not break.
......
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