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

Delta Between Two Patch Sets: lib/filterClasses.js

Issue 29861585: Issue 6871 - Reject filters with blank CSPs (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Created Aug. 22, 2018, 7:44 p.m.
Right 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | test/filterClasses.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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;
784 else if (type == RegExpFilter.typeMap.CSP && !value) 787 }
785 return new InvalidFilter(origText, "filter_invalid_csp");
786 } 788 }
787 } 789 }
788 else 790 else
789 { 791 {
790 switch (option.toLowerCase()) 792 switch (option.toLowerCase())
791 { 793 {
792 case "match-case": 794 case "match-case":
793 matchCase = !inverse; 795 matchCase = !inverse;
794 break; 796 break;
795 case "domain": 797 case "domain":
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 1171
1170 /** 1172 /**
1171 * Script that should be executed 1173 * Script that should be executed
1172 * @type {string} 1174 * @type {string}
1173 */ 1175 */
1174 get script() 1176 get script()
1175 { 1177 {
1176 return this.body; 1178 return this.body;
1177 } 1179 }
1178 }); 1180 });
LEFTRIGHT

Powered by Google App Engine
This is Rietveld