Steps to reproduce:
- go to Main.WebHome
- add a comment
- right click on the edit button of the new comment, select "open on a new tab"
- look at the URL:
The xredirect section is bad.
- Save your comment
- You are redirected to /xwiki/bin/view/Main/?xpage=xpart&vm=commentsinline.vm...
Because the xredirect parameter is computed in commentsinline.vm which is loaded by an AJAX request.
$request.getQueryString() returns the current ajax query string...