Solprovider Lenya Kongregate Registration for Free Flash Games and Chat with solprovider

Microsoft Internet Explorer Adds the Full Path to the URL

Do not use this code. It does not account for subpages (pages below the top level).


MSIE adds the protocol, server name, publication id, and "authoring" to the URLs of A (anchor) tags for links. This makes the URLs unusable by visitors.

Example:
faq/completefaq.txt
becomes:
http://authoringServerName/pub/authoring/faq/completefaq.txt

After the document is published, the link may not be accessible to visitors, because they may not have access to the authoring server (unless it is the same as the live server), and they should not have access to the authoring area.

The easy solution is to never use MSIE with Kupu. If your editors always use Mozilla or Firefox when editing Lenya using Kupu, this bug will not occur.

Another solution is to fix the URLs during when Kupu saves the document:

FILE: webapp/lenya/resources/kupu/apache-lenya/lenya/kupusave.xsl

Add this match:
<xsl:template match="@href">
<xsl:attribute name="href"><xsl:choose>
<xsl:when test="starts-with(., 'http://127.0.0.1:8888/default/authoring/')"><xsl:value-of select="substring-after(., 'http://127.0.0.1:8888/default/authoring/')"/></xsl:when>
<xsl:when test="starts-with(., 'http://productionEditServer/default/authoring/')"><xsl:value-of select="substring-after(., 'http://productionEditServer/default/authoring/')"/></xsl:when>
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
</xsl:choose></xsl:attribute>
</xsl:template>

<xsl:template match="@*|node()" priority="-1">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>


An xsl:when line needs to be added for every publication on every server. If someone writes a more generic fix, please send it to me.

I also recommend changing the priority for the last match, as seen in the above code. It does not seem to affect execution because a specific match ("@href") should override a general match ("@*") , but it is better not to have multiple matches at the same priority.

<< AlignmentContents >>

Contact Solprovider
Paul Ercolino