1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-14 23:12:28 +02:00

Mind escape sequences when validating :style filters

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/668
This commit is contained in:
Raymond Hill 2019-07-13 07:49:07 -04:00
parent 81e8d8d867
commit 3b0d214633
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -651,7 +651,6 @@
api.compileSelector = (function() {
const reAfterBeforeSelector = /^(.+?)(::?after|::?before|::[a-z-]+)$/;
const reStyleSelector = /^(.+?):style\((.+?)\)$/;
const reStyleBad = /url\(/;
const reExtendedSyntax = /\[-(?:abp|ext)-[a-z-]+=(['"])(?:.+?)(?:\1)\]/;
const reExtendedSyntaxParser = /\[-(?:abp|ext)-([a-z-]+)=(['"])(.+?)\2\]/;
const div = document.createElement('div');
@ -671,6 +670,8 @@
div.style.cssText = '';
return true;
};
// https://github.com/uBlockOrigin/uBlock-issues/issues/668
const reStyleBad = /url\(|\\/i;
const entryPoint = function(raw) {
entryPoint.pseudoclass = false;