AdguardTeam / AdguardBrowserExtension

AdGuard browser extension
https://adguard.com/
GNU General Public License v3.0
3k stars 321 forks source link

Error while parsing rules with $replace modifier #559

Closed atropnikov closed 7 years ago

atropnikov commented 7 years ago
||goodgame.ru/*.php?script=*vastInlineBannerTypeHtml$important,replace=/(<VAST[\s\S]*?>)[\s\S]*<\/VAST>/\$1<\/VAST>/

Extension doesn't correctly parse the rule above

Unknown option: 1<\/VAST>/

Extension hasn't supported this type of rule yet, but anyway it is incorrect behavior.

atropnikov commented 7 years ago

It isn't a correct fix. We should start looking from the end of the rule and find non-escaped $ sign. You can view how it is done in java code.