mirror of https://github.com/gorhill/uBlock.git
code review re #2132
This commit is contained in:
parent
368e00ef7a
commit
6f512f39fb
|
@ -1419,11 +1419,14 @@ FilterContainer.prototype._lookupUserScript = function(dict, raw, reng, out) {
|
|||
var content = reng.resourceContentFromName(token, 'application/javascript');
|
||||
if ( !content ) { return; }
|
||||
if ( args ) {
|
||||
var i = 1;
|
||||
var i = 1, arg;
|
||||
while ( args !== '' ) {
|
||||
pos = args.indexOf(',');
|
||||
if ( pos === -1 ) { pos = args.length; }
|
||||
content = content.replace('{{' + i + '}}', args.slice(0, pos).trim());
|
||||
arg = args.slice(0, pos).trim();
|
||||
if ( reArgValidator.test(arg) ) {
|
||||
content = content.replace('{{' + i + '}}', arg);
|
||||
}
|
||||
args = args.slice(pos + 1).trim();
|
||||
i++;
|
||||
}
|
||||
|
@ -1432,6 +1435,9 @@ FilterContainer.prototype._lookupUserScript = function(dict, raw, reng, out) {
|
|||
out.push(content);
|
||||
};
|
||||
|
||||
// Only accept plain word characters for now.
|
||||
var reArgValidator = /^\w*$/;
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
FilterContainer.prototype.toSelfie = function() {
|
||||
|
|
Loading…
Reference in New Issue