Commit 4bcbba22 authored by pingwin4eg's avatar pingwin4eg Committed by pifagor
Browse files

Issue #2989722 by pingwin4eg, tucho, Tessa Bakker, voleger, floown, pifagor:...

Issue #2989722 by pingwin4eg, tucho, Tessa Bakker, voleger, floown, pifagor: Double slash after base url
parent 715f6892
......@@ -36,13 +36,13 @@ class XmlSitemapMultilingualTest extends XmlSitemapMultilingualTestBase {
$this->regenerateSitemap();
// Check that the frontpage link is correct for default and non-default
// languages.
// languages. The link ends with a slash.
$frontpage_link = Url::fromRoute('<front>', [], ['absolute' => TRUE])->toString();
$this->drupalGet('sitemap.xml');
$this->assertRaw($frontpage_link, "English frontpage link found in the sitemap.");
$this->drupalGet('fr/sitemap.xml');
$this->assertRaw($frontpage_link . '/fr', "French frontpage link found in the sitemap.");
$this->assertRaw($frontpage_link . 'fr', "French frontpage link found in the sitemap.");
}
/**
......
......@@ -300,7 +300,8 @@ function xmlsitemap_install() {
$state_variables = xmlsitemap_state_variables();
\Drupal::state()->setMultiple($state_variables);
\Drupal::state()->set('xmlsitemap_base_url', Url::fromRoute('<front>', [], ['absolute' => TRUE])->toString());
$xmlsitemap_base_url = rtrim(Url::fromRoute('<front>', [], ['absolute' => TRUE])->toString(), '/');
\Drupal::state()->set('xmlsitemap_base_url', $xmlsitemap_base_url);
$context = xmlsitemap_get_current_context();
$sitemap = \Drupal::entityTypeManager()->getStorage('xmlsitemap')->create([
'id' => xmlsitemap_sitemap_get_context_hash($context),
......
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