/etc/munin/static/querystring.js is in munin 2.0.33-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | /* Client-side access to querystring name=value pairs
Version 1.3
28 May 2008
License (Simplified BSD):
http://adamv.com/dev/javascript/qslicense.txt
*/
function Querystring(qs) { // optionally pass a querystring to parse
this.params = {};
var query_string = window.location.search;
if (qs == null) qs = query_string.substring(1, query_string.length);
if (qs.length == 0) return;
// Turn <plus> back to <space>
// See: http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4.1
qs = qs.replace(/\+/g, ' ');
var args = qs.split('&'); // parse out name/value pairs separated via &
// split out each name=value pair
for (var i = 0; i < args.length; i++) {
var pair = args[i].split('=');
var name = decodeURIComponent(pair[0]);
var value = (pair.length==2)
? decodeURIComponent(pair[1])
: name;
this.params[name] = value;
}
}
Querystring.prototype.get = function(key, default_) {
var value = this.params[key];
return (value != null) ? value : default_;
}
Querystring.prototype.contains = function(key) {
var value = this.params[key];
return (value != null);
}
|