From 0064cb9a923cdd660a78f100d28f6715b0522efa Mon Sep 17 00:00:00 2001 From: Thomas Steur <tsteur@users.noreply.github.com> Date: Thu, 27 Apr 2017 09:23:06 +1200 Subject: [PATCH] Fix propagateNewPage does not work when no URL parameters are set (#11652) to reproduce eg go to https://www.example.com and then execute this method. It would generate a URL like https://www.example.com/module=Foo&action=bar --- plugins/CoreHome/javascripts/broadcast.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/CoreHome/javascripts/broadcast.js b/plugins/CoreHome/javascripts/broadcast.js index 7117a0fb69..d279598039 100644 --- a/plugins/CoreHome/javascripts/broadcast.js +++ b/plugins/CoreHome/javascripts/broadcast.js @@ -304,6 +304,11 @@ var broadcast = { // available in global scope var currentSearchStr = window.location.search; var currentHashStr = broadcast.getHashFromUrl(); + + if (!currentSearchStr) { + currentSearchStr = '?'; + } + var oldUrl = currentSearchStr + currentHashStr; for (var i = 0; i < params_vals.length; i++) { -- GitLab