mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-02 09:09:38 +02:00
fix #3506
This commit is contained in:
parent
b0600645a6
commit
94c8cfc3f3
@ -76,7 +76,7 @@ var nameToActionMap = {
|
||||
// For performance purpose, as simple tests as possible
|
||||
var reHostnameVeryCoarse = /[g-z_-]/;
|
||||
var reIPv4VeryCoarse = /\.\d+$/;
|
||||
var reBadHostname = /[^0-9a-z_.\[\]:-]/;
|
||||
var reBadHostname = /[^0-9a-z_.\[\]:%-]/;
|
||||
|
||||
// http://tools.ietf.org/html/rfc5952
|
||||
// 4.3: "MUST be represented in lowercase"
|
||||
|
@ -869,6 +869,7 @@ var untangleRules = function(s) {
|
||||
var firewallRules = [];
|
||||
var urlRules = [];
|
||||
var switches = [];
|
||||
var reIsSwitchRule = /^[a-z-]+:\s/;
|
||||
|
||||
while ( lineBeg < textEnd ) {
|
||||
lineEnd = s.indexOf('\n', lineBeg);
|
||||
@ -881,12 +882,12 @@ var untangleRules = function(s) {
|
||||
line = s.slice(lineBeg, lineEnd).trim();
|
||||
lineBeg = lineEnd + 1;
|
||||
|
||||
if ( line.indexOf('://') !== -1 ) {
|
||||
urlRules.push(line);
|
||||
} else if ( line.indexOf(':') === -1 ) {
|
||||
firewallRules.push(line);
|
||||
} else {
|
||||
if ( reIsSwitchRule.test(line) ) {
|
||||
switches.push(line);
|
||||
} else if ( line.indexOf('://') !== -1 ) {
|
||||
urlRules.push(line);
|
||||
} else {
|
||||
firewallRules.push(line);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user