]> git.deb.at Git - pkg/blosxom.git/commitdiff
Bugfix: Default RSS feed failed feed validation at http://www.feedvalidator.org/...
authorAxel Beckert <xtaran@users.sourceforge.net>
Tue, 22 Jul 2008 01:46:08 +0000 (01:46 +0000)
committerAxel Beckert <xtaran@users.sourceforge.net>
Tue, 22 Jul 2008 01:46:08 +0000 (01:46 +0000)
blosxom.cgi

index 341d2967c87773a2922f7975c4ddef395afa8bfe..2e6181fee151acdaa4a6685941cf9b4d3ada775a 100755 (executable)
@@ -661,6 +661,15 @@ sub generate {
             }
 
             if ( $encode_xml_entities && $content_type =~ m{\bxml\b} ) {
             }
 
             if ( $encode_xml_entities && $content_type =~ m{\bxml\b} ) {
+                # Escape special characters inside the <link> container
+
+                # The following line should be moved more towards to top for
+                # performance reasons -- Axel Beckert, 2008-07-22
+                my $url_escape_re = qr([^-/a-zA-Z0-9:._]);
+
+                $url   =~ s($url_escape_re)(sprintf('%%%02X', ord($&)))eg;
+                $path  =~ s($url_escape_re)(sprintf('%%%02X', ord($&)))eg;
+                $fn    =~ s($url_escape_re)(sprintf('%%%02X', ord($&)))eg;
 
                 # Escape <, >, and &, and to produce valid RSS
                 my %escape = (
 
                 # Escape <, >, and &, and to produce valid RSS
                 my %escape = (