Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/abp2blocklist.js

Issue 29468579: Issue 5332 - Do not filter out rules containing non-ASCII characters (Closed) Base URL: https://hg.adblockplus.org/abp2blocklist
Patch Set: Created June 19, 2017, 4:09 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/abp2blocklist.js » ('j') | test/abp2blocklist.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/abp2blocklist.js
===================================================================
--- a/lib/abp2blocklist.js
+++ b/lib/abp2blocklist.js
@@ -320,40 +320,16 @@
trigger["unless-top-url"] = [trigger["url-filter"]];
if (trigger["url-filter-is-case-sensitive"])
trigger["top-url-filter-is-case-sensitive"] = true;
}
rules.push({trigger: trigger, action: {type: action}});
}
-function hasNonASCI(obj)
-{
- if (typeof obj == "string")
- {
- if (/[^\x00-\x7F]/.test(obj))
- return true;
- }
-
- if (typeof obj == "object")
- {
- if (obj instanceof Array)
- for (let item of obj)
- if (hasNonASCI(item))
- return true;
-
- let names = Object.getOwnPropertyNames(obj);
- for (let name of names)
- if (hasNonASCI(obj[name]))
- return true;
- }
-
- return false;
-}
-
function convertIDSelectorsToAttributeSelectors(selector)
{
// First we figure out where all the IDs are
let sep = "";
let start = null;
let positions = [];
for (let i = 0; i < selector.length; i++)
{
@@ -539,10 +515,10 @@
{
convertFilterAddRules(rules, filter, "block", true,
requestFilterExceptionDomains);
}
for (let filter of this.requestExceptions)
convertFilterAddRules(rules, filter, "ignore-previous-rules", true);
- return rules.filter(rule => !hasNonASCI(rule));
+ return rules;
};
« no previous file with comments | « no previous file | test/abp2blocklist.js » ('j') | test/abp2blocklist.js » ('J')

Powered by Google App Engine
This is Rietveld