Ignore:
Timestamp:
2017-05-11T16:37:44+12:00 (7 years ago)
Author:
ak19
Message:

Correction to generating login URL. When reconstituting the URL without any pre-existing logout portion, to generate the new logout link, we need to retain anything that may come after the pre-existing logout part of the URL.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/transform/layouts/header.xsl

    r31654 r31674  
    439439   
    440440    <xsl:variable name="url" select="/page/pageRequest/@fullURL"/>
    441     <xsl:variable name="tmpURL" select="substring-before($url, '&amp;amp;logout=')"/>
     441    <xsl:variable name="beforeLogout" select="substring-before($url, '&amp;amp;logout=')"/>
     442    <xsl:variable name="tmpAfter" select="substring-after($url, '&amp;amp;logout=')"/>
     443    <xsl:variable name="afterLogout" select="substring-after($tmpAfter, '&amp;amp;')"/>
    442444    <xsl:variable name="beforeHash" select="substring-before($url, '#')"/>
    443445    <xsl:variable name="afterHash" select="substring-after($url, '#')"/>
    444446    <!-- Get rid of any lingering &amp;logout= already in the URL.
    445      Can't use fn:replace() as it's only been defined since XSLT 2.0. We use XSLT 1.x -->
     447        But retain anything before and after it (the after portion would start with &).
     448        Can't use fn:replace() as it's only been defined since XSLT 2.0. We use XSLT 1.x -->
    446449    <xsl:variable name="fullURL">
    447450      <xsl:choose>
    448     <xsl:when test="$tmpURL != ''"><xsl:value-of select="$tmpURL" /></xsl:when>
    449     <xsl:otherwise><xsl:value-of select="$url" /></xsl:otherwise>
    450       </xsl:choose>
     451        <xsl:when test="$beforeLogout != ''"><xsl:value-of select="$beforeLogout" /></xsl:when>
     452        <xsl:otherwise><xsl:value-of select="$url" /></xsl:otherwise>
     453      </xsl:choose>   
     454      <xsl:if test="$afterLogout != ''">&amp;<xsl:value-of select="$afterLogout" /></xsl:if>     
    451455    </xsl:variable>
    452456
Note: See TracChangeset for help on using the changeset viewer.