1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-04 08:37:11 +02:00
This commit is contained in:
gorhill 2016-02-04 08:21:59 -05:00
parent 062eed9413
commit a89f908a16

View File

@ -192,6 +192,14 @@ uDom.nodeFromId('why').textContent = details.fs;
return li; return li;
}; };
var safeDecodeURIComponent = function(s) {
try {
s = decodeURIComponent(s);
} catch (ex) {
}
return s;
};
var renderParams = function(parentNode, rawURL) { var renderParams = function(parentNode, rawURL) {
var a = document.createElement('a'); var a = document.createElement('a');
a.href = rawURL; a.href = rawURL;
@ -214,8 +222,8 @@ uDom.nodeFromId('why').textContent = details.fs;
if ( pos === -1 ) { if ( pos === -1 ) {
pos = param.length; pos = param.length;
} }
name = decodeURIComponent(param.slice(0, pos)); name = safeDecodeURIComponent(param.slice(0, pos));
value = decodeURIComponent(param.slice(pos + 1)); value = safeDecodeURIComponent(param.slice(pos + 1));
li = liFromParam(name, value); li = liFromParam(name, value);
if ( reURL.test(value) ) { if ( reURL.test(value) ) {
ul = document.createElement('ul'); ul = document.createElement('ul');