Opened 5 years ago

Closed 5 years ago

#1587 closed defect (fixed)

"Block element" generates blocking instead elemhide filters when the selector contains curly brackets

Reported by: sebastian Assignee: sebastian
Priority: P4 Milestone: Adblock-Plus-1.8.8-for-Chrome-Opera-Safari
Module: Platform Keywords:
Cc: Blocked By:
Blocking: Platform: Unknown
Ready: yes Confidential: no
Tester: Verified working: no
Review URL(s):

http://codereview.adblockplus.org/5989801094283264

Description

How to reproduce

  1. Click the ABP icon
  2. Choose "Block element"
  3. Choose an element which has an ID or class containing { or } (You might want to use the inspector to produce such a case).
  4. Save the generated filter
  5. Reload the page

Observed behaviour

The curly brackets are escaped as \{ and \} in the generated selector. While this is valid CSS, curly brackets (even if prepended by a backslash) must not occur in elemhide filters. Therefore the filter is interpreted as blocking filter, and doesn't block the relevant element.

Expected behaviour

Curly brackets should be escaped based on their code point, that the filter is interpreted as elemhide filter, and blocks the relevant element.

Change History (2)

comment:1 Changed 5 years ago by sebastian

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:2 Changed 5 years ago by sebastian

  • Milestone set to Adblock-Plus-for-Chrome-Opera-Safari-next
  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.