You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by ne...@apache.org on 2007/04/25 10:53:22 UTC

svn commit: r532267 - in /lenya/trunk/src/modules/svg: config/module.xml xslt/image2svg.xsl

Author: nettings
Date: Wed Apr 25 01:53:20 2007
New Revision: 532267

URL: http://svn.apache.org/viewvc?view=rev&rev=532267
Log:
added check for existing query string to avoid duplicate parameters and
an invalid uri. this fixes bug
http://issues.apache.org/bugzilla/show_bug.cgi?id=42229

Modified:
    lenya/trunk/src/modules/svg/config/module.xml
    lenya/trunk/src/modules/svg/xslt/image2svg.xsl

Modified: lenya/trunk/src/modules/svg/config/module.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/svg/config/module.xml?view=diff&rev=532267&r1=532266&r2=532267
==============================================================================
--- lenya/trunk/src/modules/svg/config/module.xml (original)
+++ lenya/trunk/src/modules/svg/config/module.xml Wed Apr 25 01:53:20 2007
@@ -22,7 +22,9 @@
   <id>org.apache.lenya.modules.svg</id>
   <package>org.apache.lenya.modules</package>
   <version>0.1-dev</version>
-  <name>SVG</name>
+  <name>SVG image rendering</name>
   <lenya-version>@lenya.version@</lenya-version>
-  <description>SVG-based image rendering</description>
+  <description>The SVG module generates the rounded corners for
+  the Lenya dialogs, and re-scales pixel-based GIF, JPG and PNG images on the
+  fly, depending on height and width query parameters. It uses Batik.</description>
 </module>

Modified: lenya/trunk/src/modules/svg/xslt/image2svg.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/svg/xslt/image2svg.xsl?view=diff&rev=532267&r1=532266&r2=532267
==============================================================================
--- lenya/trunk/src/modules/svg/xslt/image2svg.xsl (original)
+++ lenya/trunk/src/modules/svg/xslt/image2svg.xsl Wed Apr 25 01:53:20 2007
@@ -21,7 +21,18 @@
   
   <xsl:template match="xhtml:img[@height and @width]/@src">
     <xsl:attribute name="src">
-      <xsl:value-of select="."/>
+      <!-- if the src attribute already contains a querystring, cut it off. otherwise, multiple
+           querystrings can accumulate! 
+           NB: substring-before returns the empty string if the needle is not found.
+      -->
+      <xsl:choose>
+        <xsl:when test="contains(.,'?')">
+           <xsl:value-of select="substring-before(.,'?')"/>
+        </xsl:when>
+        <xsl:otherwise>
+           <xsl:value-of select="."/>
+        </xsl:otherwise>
+      </xsl:choose>
       <xsl:text>?</xsl:text>
       <xsl:text>lenya.module=svg&amp;</xsl:text>
       <xsl:if test="string(../@height)">



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org