Fixed digg/reddit/etc... buttons so that they encode url properly.
authorDavid Bartley <dtbartle@csclub.uwaterloo.ca>
Sun, 12 Aug 2007 20:27:28 +0000 (16:27 -0400)
committerDavid Bartley <dtbartle@csclub.uwaterloo.ca>
Sun, 12 Aug 2007 20:27:28 +0000 (16:27 -0400)
xsl/media.xsl

index ca5d3a5..cfa5cc5 100644 (file)
@@ -52,7 +52,7 @@
   <xsl:param name="infotext" />
   <xsl:param name="mirror" />
   <xsl:param name="bittorrent" />
-  <xsl:variable name="realurl" select="fn:encode-for-uri(concat('http://csclub.uwaterloo.ca/media/', @title, '.html'))" />
+  <xsl:variable name="realurl" select="concat('http://csclub.uwaterloo.ca/media/', fn:encode-for-uri(@title), '.html')" />
   <xsl:result-document method="xml" encoding="ISO-8859-1" 
       doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" 
       doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
           <!-- reddit button -->
           <script type="text/javascript">
             reddit_url = '<xsl:value-of select="$realurl" />';
-            reddit_title = '<xsl:value-of select="@title" />';
+            reddit_title = '<xsl:value-of select="fn:encode-for-uri(@title)" />';
           </script>
           <script src="http://reddit.com/button.js?t=3"
                   type="text/javascript"><xsl:text> </xsl:text></script>
         <br/>
         <!-- AddThis Bookmark Button -->
         <script type="text/javascript">
-          addthis_url    = '<xsl:value-of select="$realurl" />';
-          addthis_title  = document.title;
-          addthis_pub    = 'calumt';
+          addthis_url = '<xsl:value-of select="$realurl" />';
+          addthis_title = document.title;
+          addthis_pub = 'calumt';
         </script>
         <script type="text/javascript"
             src="http://s7.addthis.com/js/addthis_widget.php?v=12"><xsl:text> </xsl:text></script>