Merge "Make variant selection menu toggleable by keyboard"
[lhc/web/wiklou.git] / maintenance / generateSitemap.php
index b356d18..4f6bed5 100644 (file)
@@ -26,7 +26,7 @@
  * @see http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd
  */
 
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
 
 /**
  * Maintenance script that generates a sitemap for the site.
@@ -490,7 +490,8 @@ class GenerateSitemap extends Maintenance {
        function fileEntry( $url, $date, $priority ) {
                return
                        "\t<url>\n" .
-                       "\t\t<loc>$url</loc>\n" .
+                       // bug 34666: $url may contain bad characters such as ampersands.
+                       "\t\t<loc>" . htmlspecialchars( $url ) . "</loc>\n" .
                        "\t\t<lastmod>$date</lastmod>\n" .
                        "\t\t<priority>$priority</priority>\n" .
                        "\t</url>\n";
@@ -521,4 +522,4 @@ class GenerateSitemap extends Maintenance {
 }
 
 $maintClass = "GenerateSitemap";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;