mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
fix #3506
This commit is contained in:
parent
b0600645a6
commit
94c8cfc3f3
2 changed files with 7 additions and 6 deletions
|
|
@ -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 a new issue