Skip to content
This repository was archived by the owner on Dec 20, 2025. It is now read-only.

Commit 4fafbbd

Browse files
Apparently Google doesn't like https everywhere afterall. (#50)
1 parent cde221c commit 4fafbbd

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

spec/OutputSpec.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function it_should_format_a_sitemapindex_with_n_sitemaps()
2222
{
2323
$xml = <<<XML
2424
<?xml version="1.0" encoding="UTF-8"?>
25-
<sitemapindex xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://www.sitemaps.org/schemas/sitemap/0.9 https://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd" xmlns="https://www.sitemaps.org/schemas/sitemap/0.9">
25+
<sitemapindex xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
2626
<sitemap>
2727
<loc>https://www.example.com/sitemap1.xml.gz</loc>
2828
</sitemap>
@@ -43,7 +43,7 @@ function it_should_generate_a_sitemap_of_images()
4343
{
4444
$xml = <<<XML
4545
<?xml version="1.0" encoding="UTF-8"?>
46-
<urlset xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://www.sitemaps.org/schemas/sitemap/0.9 https://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd" xmlns="https://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="https://www.google.com/schemas/sitemap-image/1.1">
46+
<urlset xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="https://www.google.com/schemas/sitemap-image/1.1">
4747
<url>
4848
<loc>https://www.example.com/1</loc>
4949
<image:image>
@@ -101,7 +101,7 @@ function it_should_generate_a_sitemap_with_links()
101101
{
102102
$xml = <<<XML
103103
<?xml version="1.0" encoding="UTF-8"?>
104-
<urlset xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://www.sitemaps.org/schemas/sitemap/0.9 https://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd" xmlns="https://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="https://www.w3.org/1999/xhtml">
104+
<urlset xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
105105
<url>
106106
<loc>https://www.example.com/english/</loc>
107107
<xhtml:link rel="alternate" hreflang="de" href="https://www.example.com/deutsch/"/>
@@ -149,7 +149,7 @@ function it_should_write_processing_instructions()
149149
$xml = <<<XML
150150
<?xml version="1.0" encoding="UTF-8"?>
151151
<?xml-stylesheet type="text/xsl" href="/path/to/xslt/main-sitemap.xsl"?>
152-
<urlset xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://www.sitemaps.org/schemas/sitemap/0.9 https://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd" xmlns="https://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="https://www.w3.org/1999/xhtml">
152+
<urlset xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
153153
<url>
154154
<loc>https://www.example.com/english/</loc>
155155
<xhtml:link rel="alternate" hreflang="de" href="https://www.example.com/deutsch/"/>

spec/UrlsetSpec.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ function it_should_only_append_attributes_once_for_each_subelement_type(XMLWrite
3232
{
3333
$xmlWriter->startElement('urlset')->shouldBeCalled();
3434
$xmlWriter->writeAttribute('xmlns:xsi', 'https://www.w3.org/2001/XMLSchema-instance')->shouldBeCalled();
35-
$xmlWriter->writeAttribute('xsi:schemaLocation', 'https://www.sitemaps.org/schemas/sitemap/0.9 ' . 'https://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd')->shouldBeCalled();
36-
$xmlWriter->writeAttribute('xmlns', 'https://www.sitemaps.org/schemas/sitemap/0.9')->shouldBeCalled();
35+
$xmlWriter->writeAttribute('xsi:schemaLocation', 'http://www.sitemaps.org/schemas/sitemap/0.9 ' . 'http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd')->shouldBeCalled();
36+
$xmlWriter->writeAttribute('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9')->shouldBeCalled();
3737

3838
$url->getSubelementsThatAppend()->willReturn([$image, $video]);
3939
$this->appendSubelementAttribute($xmlWriter, $image)->shouldReturn(true);

src/SitemapIndex.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ public function generateXML(XMLWriter $XMLWriter)
4242

4343
$XMLWriter->writeAttribute(
4444
'xsi:schemaLocation',
45-
'https://www.sitemaps.org/schemas/sitemap/0.9 ' .
46-
'https://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd'
45+
'http://www.sitemaps.org/schemas/sitemap/0.9 ' .
46+
'http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd'
4747
);
4848

49-
$XMLWriter->writeAttribute('xmlns', 'https://www.sitemaps.org/schemas/sitemap/0.9');
49+
$XMLWriter->writeAttribute('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9');
5050

5151
foreach ($this->getSitemaps() as $sitemap) {
5252
$sitemap->generateXML($XMLWriter);

src/Subelements/Link.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function generateXML(XMLWriter $XMLWriter)
5656
*/
5757
public function appendAttributeToCollectionXML(XMLWriter $XMLWriter)
5858
{
59-
$XMLWriter->writeAttribute('xmlns:xhtml', 'https://www.w3.org/1999/xhtml');
59+
$XMLWriter->writeAttribute('xmlns:xhtml', 'http://www.w3.org/1999/xhtml');
6060
}
6161

6262
/**

src/Urlset.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ public function generateXML(XMLWriter $XMLWriter)
4949
$XMLWriter->writeAttribute('xmlns:xsi', 'https://www.w3.org/2001/XMLSchema-instance');
5050

5151
$XMLWriter->writeAttribute('xsi:schemaLocation',
52-
'https://www.sitemaps.org/schemas/sitemap/0.9 ' .
53-
'https://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd');
52+
'http://www.sitemaps.org/schemas/sitemap/0.9 ' .
53+
'http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd');
5454

55-
$XMLWriter->writeAttribute('xmlns', 'https://www.sitemaps.org/schemas/sitemap/0.9');
55+
$XMLWriter->writeAttribute('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9');
5656

5757
foreach ($this->getUrls() as $url) {
5858
foreach ($url->getSubelementsThatAppend() as $subelement) {

0 commit comments

Comments
 (0)