Skip to content

Commit

Permalink
XWIKI-20571: Livetable parameters cannot be recovered with URI encoding
Browse files Browse the repository at this point in the history
* Undo encoding of "|" in certain cases to recover the parameters.
  • Loading branch information
michitux committed Jan 24, 2023
1 parent 1b87fec commit df79bd8
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,13 @@ var LiveTableHash = Class.create({

var hashString = window.location.hash.substring(1);
if (!hashString.blank()) {
// Recover from encoding done by URI implementations (like java.net.URI) that don't allow | in the fragment.
if (hashString.indexOf('%7Ct=') !== -1) {
// The string "%7Ct=" is safe to replace as it cannot occur in a filter as there the "=" would have been encoded,
// too.
hashString = hashString.replaceAll('%7Ct=', '|t=');
window.location.hash = "#" + hashString;
}
var tables = hashString.split("|");
for (var i = 0; i < tables.length; i++) {
var params = tables[i].toQueryParams();
Expand Down

0 comments on commit df79bd8

Please sign in to comment.