Skip to content

Instantly share code, notes, and snippets.

@felipelavinz
Created April 29, 2013 15:31
Show Gist options
  • Save felipelavinz/67899acb59ac2be314ac to your computer and use it in GitHub Desktop.
Save felipelavinz/67899acb59ac2be314ac to your computer and use it in GitHub Desktop.
WordPress SEO URL encoding fix
--- class-sitemaps.php
+++ class-sitemaps.php
@@ -550,6 +550,7 @@
$date = mysql2date( "Y-m-d\TH:i:s+00:00", $url['mod'] );
else
$date = date( 'c' );
+ $url['loc'] = htmlspecialchars( $url['loc'] );
$output = "\t<url>\n";
$output .= "\t\t<loc>" . $url['loc'] . "</loc>\n";
$output .= "\t\t<lastmod>" . $date . "</lastmod>\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment