Opened 9 months ago

Last modified 4 months ago

#7268 closed defect

ContainsSelector element hide emulation doesn't work with {} in regexp — at Initial Version

Reported by: hfiguiere Assignee:
Priority: P2 Milestone:
Module: Core Keywords:
Cc: Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Ross Verified working: yes
Review URL(s):

https://codereview.adblockplus.org/30006562/

Description

Environment

ContainsSelector element hide emulation doesn't work with {} in regexp.
This is because in ElemHideBase.selector() we escape
{ and } to prevent CSS injection but the ContainsSelector constructor doesn't put them back.

How to reproduce

  1. Create an advanced selector filter with :-abp-contains() and a regexp that contain a quantifier {n}. Something like
    example.com#?#div:-abp-contains([aAbB]{9,})
    

(this would match a div that contains a string of at least 9 consecutive chars that are within 'aAbB')

Observed behaviour

Filter doesn't apply

Expected behaviour

Filter should apply

Change History (0)

Note: See TracTickets for help on using tickets.