From 88d0828bf0944d6a785906e2af6806992cf058fa Mon Sep 17 00:00:00 2001 From: VitalyM Date: Mon, 29 Oct 2018 11:39:46 -0500 Subject: [PATCH] Issue #2930268 by VitalyM, eyilmaz: Fixed context arrays should be sorted using ksort() instead of asort() prior to hashing to ensure consistency with more than one context. --- xmlsitemap.install | 7 +++++++ xmlsitemap.module | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/xmlsitemap.install b/xmlsitemap.install index 045eadb1..e5bf7dd7 100644 --- a/xmlsitemap.install +++ b/xmlsitemap.install @@ -567,6 +567,13 @@ function xmlsitemap_update_7203() { _xmlsitemap_sitemap_rehash_all(); } +/** + * Rehash all sitemaps according to new context sorting. + */ +function xmlsitemap_update_7204() { + _xmlsitemap_sitemap_rehash_all(); +} + /** * Rehash all. */ diff --git a/xmlsitemap.module b/xmlsitemap.module index 52fee5cf..a05c7c83 100644 --- a/xmlsitemap.module +++ b/xmlsitemap.module @@ -531,7 +531,7 @@ function xmlsitemap_sitemap_get_max_filesize(stdClass $sitemap) { * Get context. */ function xmlsitemap_sitemap_get_context_hash(array &$context) { - asort($context); + ksort($context); return drupal_hash_base64(serialize($context)); } @@ -1591,7 +1591,7 @@ function xmlsitemap_get_current_context() { if (!isset($context)) { $context = module_invoke_all('xmlsitemap_context'); drupal_alter('xmlsitemap_context', $context); - asort($context); + ksort($context); } return $context; -- GitLab