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

Side by Side Diff: lib/filterClasses.js

Issue 29582689: Noissue - Fix the escaping of '{' and '}' in CSS selectors (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Also update the content script Created Oct. 18, 2017, 7:39 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/content/elemHideEmulation.js ('k') | test/browser/elemHideEmulation.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 { 902 {
903 ActiveFilter.call(this, text, domains || null); 903 ActiveFilter.call(this, text, domains || null);
904 904
905 if (domains) 905 if (domains)
906 { 906 {
907 this.selectorDomain = domains.replace(/,~[^,]+/g, "") 907 this.selectorDomain = domains.replace(/,~[^,]+/g, "")
908 .replace(/^~[^,]+,?/, "").toLowerCase(); 908 .replace(/^~[^,]+,?/, "").toLowerCase();
909 } 909 }
910 910
911 // Braces are being escaped to prevent CSS rule injection. 911 // Braces are being escaped to prevent CSS rule injection.
912 this.selector = selector.replace("{", "\\x7B ").replace("}", "\\x7D "); 912 this.selector = selector.replace("{", "\\7B ").replace("}", "\\7D ");
913 } 913 }
914 exports.ElemHideBase = ElemHideBase; 914 exports.ElemHideBase = ElemHideBase;
915 915
916 ElemHideBase.prototype = extend(ActiveFilter, { 916 ElemHideBase.prototype = extend(ActiveFilter, {
917 /** 917 /**
918 * @see ActiveFilter.domainSeparator 918 * @see ActiveFilter.domainSeparator
919 */ 919 */
920 domainSeparator: ",", 920 domainSeparator: ",",
921 921
922 /** 922 /**
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 */ 1019 */
1020 function ElemHideEmulationFilter(text, domains, selector) 1020 function ElemHideEmulationFilter(text, domains, selector)
1021 { 1021 {
1022 ElemHideBase.call(this, text, domains, selector); 1022 ElemHideBase.call(this, text, domains, selector);
1023 } 1023 }
1024 exports.ElemHideEmulationFilter = ElemHideEmulationFilter; 1024 exports.ElemHideEmulationFilter = ElemHideEmulationFilter;
1025 1025
1026 ElemHideEmulationFilter.prototype = extend(ElemHideBase, { 1026 ElemHideEmulationFilter.prototype = extend(ElemHideBase, {
1027 type: "elemhideemulation" 1027 type: "elemhideemulation"
1028 }); 1028 });
OLDNEW
« no previous file with comments | « lib/content/elemHideEmulation.js ('k') | test/browser/elemHideEmulation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld