URLs must be escaped inside XML, e.g. inside the <link> container, too.
[matthijs/upstream/blosxom.git] / blosxom.cgi
index 674ff10f7a691e686b3d42cad6555ef2b76c3348..341d2967c87773a2922f7975c4ddef395afa8bfe 100755 (executable)
@@ -1,8 +1,8 @@
 #!/usr/bin/perl
 
 # Blosxom
-# Author: Rael Dornfest <rael@oreilly.com>
-# Version: 2.0.2
+# Author: Rael Dornfest (2003), The Blosxom Development Team (2005-2008)
+# Version: 2.1.0
 # Home/Docs/Licensing: http://blosxom.sourceforge.net/
 # Development/Downloads: http://sourceforge.net/projects/blosxom
 
@@ -88,7 +88,7 @@ use File::stat;
 use Time::Local;
 use CGI qw/:standard :netscape/;
 
-$version = "2.0.2";
+$version = "2.1.0";
 
 # Should I encode entities for xml content-types? (plugins can turn this off if they do it themselves)
 $encode_xml_entities = 1;
@@ -667,11 +667,15 @@ sub generate {
                     '<' => '&lt;',
                     '>' => '&gt;',
                     '&' => '&amp;',
-                    '"' => '&quot;'
+                    '"' => '&quot;',
+                    "'" => '&apos;'
                 );
                 my $escape_re = join '|' => keys %escape;
                 $title =~ s/($escape_re)/$escape{$1}/g;
                 $body  =~ s/($escape_re)/$escape{$1}/g;
+                $url   =~ s/($escape_re)/$escape{$1}/g;
+                $path  =~ s/($escape_re)/$escape{$1}/g;
+                $fn    =~ s/($escape_re)/$escape{$1}/g;
             }
 
             $story = &$interpolate($story);