Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8.3, 3.0
    • Component/s: Templates and UI
    • Labels:
      None
    • Environment:

      Vista 32bit
      Tomcat 6.0.18
      JSPWiki 2.8.0-beta1

      Description

      IPv6 localhost address is displayed as "0:0:0:0:0:0:0:1" - But UserBox.jsp (user status is asserted), line 20 shows:

      <fmt:param><wiki:Translate>[<wiki:UserName />]</wiki:Translate></fmt:param>

      So the rendered UserName looks like [0:0:0:0:0:0:0:1] - the wiki interpreter tries to render an inter-wiki-link "0", that causes an error box (markupparser.error.nointerwikiref).

      To reproduce:
      Run JSPWiki on the local machine with an IPv6 network
      Log out
      As anonymous user goto the preferences
      Save the user preferences.
      Now the UserBox is broken.

      Solution: Add a second opening square bracket

      <fmt:param><wiki:Translate>[[<wiki:UserName />]</wiki:Translate></fmt:param>

        Issue Links

          Activity

          Hide
          Janne Jalkanen added a comment -

          I think the comment is valid but the solution is wrong - we do want to have a link to the UserName. The easy solution would be to simply add an UserCheck around the UserName to make sure that the user is logged in. This way the IP address is not shown.

          Show
          Janne Jalkanen added a comment - I think the comment is valid but the solution is wrong - we do want to have a link to the UserName. The easy solution would be to simply add an UserCheck around the UserName to make sure that the user is logged in. This way the IP address is not shown.
          Hide
          Stefan Bohn added a comment -

          There is already a check, there are three posibilities:

          1) anonymous - uses the localized String fav.greet.anonymous
          2) asserted - the one with the wrong behavior
          3) authenticated - here the link is still generated

          The question is, if we want to link to the user, if he is already known from a former session, but has not yet logged in again.
          If we want the link in this situation, we can't use the double square braces. If it is ok, that only logged in users are linked, the solution is fine.

          Stefan

          Show
          Stefan Bohn added a comment - There is already a check, there are three posibilities: 1) anonymous - uses the localized String fav.greet.anonymous 2) asserted - the one with the wrong behavior 3) authenticated - here the link is still generated The question is, if we want to link to the user, if he is already known from a former session, but has not yet logged in again. If we want the link in this situation, we can't use the double square braces. If it is ok, that only logged in users are linked, the solution is fine. Stefan
          Hide
          Janne Jalkanen added a comment -

          With asserted the only problem could be in the case where you have mistakenly put your IP address as your WikiName. Which is only possible in 2.6 or previous.

          Perhaps this does not actually require any fixes for 2.8?

          Show
          Janne Jalkanen added a comment - With asserted the only problem could be in the case where you have mistakenly put your IP address as your WikiName. Which is only possible in 2.6 or previous. Perhaps this does not actually require any fixes for 2.8?
          Hide
          Harry Metske added a comment -

          My proposal is to add a regex-check for an IPV6 address in UserNameTag, and if it matches, add an extra opening square bracket.
          This way we solve the issue and still keep a link to asserted names (that are not IPV6 addresses).

          (there is already an excellent IP address regex available in ASF's httpclient that we can use).

          regards,
          Harry

          Show
          Harry Metske added a comment - My proposal is to add a regex-check for an IPV6 address in UserNameTag, and if it matches, add an extra opening square bracket. This way we solve the issue and still keep a link to asserted names (that are not IPV6 addresses). (there is already an excellent IP address regex available in ASF's httpclient that we can use). regards, Harry
          Hide
          Harry Metske added a comment -

          My previous proposal is a bit of a hack, but good enough for 2.8.
          For 3.0 it can be much more elegantly fixed with Stripes validation in the UserPreferencesActionBean (@Validate has the mask parameter that takes regexes), we can also fix JSPWIKI-422 that way.

          Show
          Harry Metske added a comment - My previous proposal is a bit of a hack, but good enough for 2.8. For 3.0 it can be much more elegantly fixed with Stripes validation in the UserPreferencesActionBean (@Validate has the mask parameter that takes regexes), we can also fix JSPWIKI-422 that way.
          Hide
          Harry Metske added a comment -

          Fixed in 2.8.4-svn-12 and 3.0.0-svn-218

          Show
          Harry Metske added a comment - Fixed in 2.8.4-svn-12 and 3.0.0-svn-218

            People

            • Assignee:
              Harry Metske
              Reporter:
              Stefan Bohn
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development