AdguardTeam / FiltersCompiler

A tool that compiles & validates filters
GNU Lesser General Public License v3.0
52 stars 12 forks source link

Wrong compilation of a scriptlet rule #211

Open Yuki2718 opened 7 months ago

Yuki2718 commented 7 months ago

IDK what is causing this, but amazon.de,amazon.co.jp,amazon.com#%#//scriptlet('xml-prune', 'xpath(//*[name()="Period"][.//*[@value="Ad"]] | //*[name()="Period"]/@start)', '[value="Ad"]', '.mpd') for uBO in Base is compiled into amazon.de,amazon.co.jp,amazon.com#@#+js(xml-prune, xpath(//*[name()="Period"][.//*[@value="Ad"]] | //*[name()="Period"]/@start), [value="Ad"], .mpd) and causing problem.

Yuki2718 commented 7 months ago

Another case spotted by @liamengland1 pluto.tv#%#//scriptlet('xml-prune', 'xpath(//*[name()="Period"][.//*[name()="BaseURL" and contains(text(),"_ad")]] | //*[name()="Period"]/@start | //*[name()="Period"]/@duration', '', '.mpd') => pluto.tv#@#+js(xml-prune, xpath(//*[name()="Period"][.//*[name()="BaseURL" and contains(text()\,"_ad")]] | //*[name()="Period"]/@start | //*[name()="Period"]/@duration, , .mpd)