Module: check_mk
Branch: master
Commit: 97474d632e3ddceb0f43c05aecc6a2c5c4f0a34b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=97474d632e3ddc…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Oct 2 12:23:01 2012 +0200
FIX: Fixed error in makeuri() calls when no parameters in URL
---
ChangeLog | 1 +
web/htdocs/js/checkmk.js | 12 ++++++++++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 73a9dac..734e22f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,7 @@
Mulitisite
* Added "view" parameter to dashlet_pnpgraph webservice
* FIX: BI: Assuming "OK" for hosts is now possible
+ * FIX: Fixed error in makeuri() calls when no parameters in URL
WATO
* Added "profile" option to be configurable via browser
diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js
index 9658447..9e83337 100644
--- a/web/htdocs/js/checkmk.js
+++ b/web/htdocs/js/checkmk.js
@@ -272,8 +272,16 @@ function getUrlParam(name) {
function makeuri(addvars) {
var tmp = window.location.href.split('?');
var base = tmp[0];
- tmp = tmp[1].split('#');
- tmp = tmp[0].split('&');
+ if(tmp.length > 1) {
+ // Remove maybe existing anchors
+ tmp = tmp[1].split('#');
+ // Split to array of param-strings (key=val)
+ tmp = tmp[0].split('&');
+ } else {
+ // Uri has no parameters
+ tmp = [];
+ }
+
var len = tmp.length;
var params = [];
var pair = null;