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: Created Aug. 22, 2018, 7:44 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 | no next file » | 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 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 && value)
783 csp = value; 783 csp = value;
784 else if (type == RegExpFilter.typeMap.CSP && !value)
785 return new InvalidFilter(origText, "filter_invalid_csp");
784 } 786 }
785 } 787 }
786 else 788 else
787 { 789 {
788 switch (option.toLowerCase()) 790 switch (option.toLowerCase())
789 { 791 {
790 case "match-case": 792 case "match-case":
791 matchCase = !inverse; 793 matchCase = !inverse;
792 break; 794 break;
793 case "domain": 795 case "domain":
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 1169
1168 /** 1170 /**
1169 * Script that should be executed 1171 * Script that should be executed
1170 * @type {string} 1172 * @type {string}
1171 */ 1173 */
1172 get script() 1174 get script()
1173 { 1175 {
1174 return this.body; 1176 return this.body;
1175 } 1177 }
1176 }); 1178 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld