From df79bd8c5ed4abba20689bafaf5e38cae0157689 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Fri, 20 Jan 2023 15:35:51 +0100 Subject: [PATCH] XWIKI-20571: Livetable parameters cannot be recovered with URI encoding * Undo encoding of "|" in certain cases to recover the parameters. --- .../src/main/webapp/resources/js/xwiki/table/livetable.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/resources/js/xwiki/table/livetable.js b/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/resources/js/xwiki/table/livetable.js index baa16991c815..6564f67abb90 100644 --- a/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/resources/js/xwiki/table/livetable.js +++ b/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/resources/js/xwiki/table/livetable.js @@ -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();