Skip to content

Commit

Permalink
https://github.com/AdguardTeam/AdguardBrowserExtension/issues/34
Browse files Browse the repository at this point in the history
  • Loading branch information
ameshkov committed Oct 20, 2015
1 parent 79925e4 commit cc043a7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Extension/lib/filter/rules/base-filter-rule.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ FilterRule.createRule = function (ruleText) {
return rule;
};

/**
* urlencodes rule text.
* We need this function because of this issue:
* https://github.com/AdguardTeam/AdguardBrowserExtension/issues/34
*/
FilterRule.escapeRule = function (ruleText) {
return encodeURIComponent(ruleText).replace(/'/g, "%27");
};
Expand All @@ -286,4 +291,3 @@ FilterRule.COMA_DELIMITER = ",";
FilterRule.LINE_DELIMITER = "|";
FilterRule.NOT_MARK = "~";
FilterRule.OLD_INJECT_RULES = "adg_start_style_inject";

0 comments on commit cc043a7

Please sign in to comment.