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

Side by Side Diff: lib/filterClasses.js

Issue 29861585: Issue 6871 - Reject filters with blank CSPs (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Address PS3 Comment Created Aug. 24, 2018, 8:11 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 | « no previous file | test/filterClasses.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 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 if (inverse) 772 if (inverse)
773 { 773 {
774 if (contentType == null) 774 if (contentType == null)
775 ({contentType} = RegExpFilter.prototype); 775 ({contentType} = RegExpFilter.prototype);
776 contentType &= ~type; 776 contentType &= ~type;
777 } 777 }
778 else 778 else
779 { 779 {
780 contentType |= type; 780 contentType |= type;
781 781
782 if (type == RegExpFilter.typeMap.CSP && value) 782 if (type == RegExpFilter.typeMap.CSP)
783 {
784 if (!value)
785 return new InvalidFilter(origText, "filter_invalid_csp");
783 csp = value; 786 csp = value;
787 }
784 } 788 }
785 } 789 }
786 else 790 else
787 { 791 {
788 switch (option.toLowerCase()) 792 switch (option.toLowerCase())
789 { 793 {
790 case "match-case": 794 case "match-case":
791 matchCase = !inverse; 795 matchCase = !inverse;
792 break; 796 break;
793 case "domain": 797 case "domain":
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 1171
1168 /** 1172 /**
1169 * Script that should be executed 1173 * Script that should be executed
1170 * @type {string} 1174 * @type {string}
1171 */ 1175 */
1172 get script() 1176 get script()
1173 { 1177 {
1174 return this.body; 1178 return this.body;
1175 } 1179 }
1176 }); 1180 });
OLDNEW
« no previous file with comments | « no previous file | test/filterClasses.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld