Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-10413

"Edit comment" and "Delete comment" URLs have a bad "xredirect" parameter

    Details

    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      Steps to reproduce:

      1. go to Main.WebHome
      2. add a comment
      3. right click on the edit button of the new comment, select "open on a new tab"
      4. look at the URL:
        http://localhost:8080/xwiki/bin/view/Main/?viewer=comments&number=0&xredirect=/xwiki/bin/view/Main/?xpage=xpart&vm=commentsinline.vm

      The xredirect section is bad.

      1. Save your comment
      2. You are redirected to /xwiki/bin/view/Main/?xpage=xpart&vm=commentsinline.vm...

      Why?

      Because the xredirect parameter is computed in commentsinline.vm which is loaded by an AJAX request.

      commentsinline.vm
      #set($xredirect = $!escapetool.xml($request.get("xredirect")))
      #if("$!xredirect" == '')
        #set($xredirect = "$doc.getURL('view')?$request.getQueryString()")
      #end
      

      $request.getQueryString() returns the current ajax query string...

      It is a minor problem because usually people edit their comment inline with JavaScript.

        Attachments

          Activity

            People

            • Assignee:
              vmassol Vincent Massol
              Reporter:
              gdelhumeau Guillaume Delhumeau
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: